jPanel を作成し、ボタンをクリックすると新しい jDialog を開きます (dlgSegments は開いた JDialog です)。
JButton btnAddSegment = new JButton("Add GeoSegment");
btnAddSegment.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dlgSegments.setVisible(true);
}
});
次に、開いたjDialogで、「選択した」をこのjDialogを呼び出したjPanelに戻したいと思います。
どうすれば実装できますか?
これは、開いた jDialog のボタン リスナーで、seleced は jPanel に渡したい変数です。
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GeoSegment selected = lstSegments.getSelectedValue();
// i want to send back the selected value
}
});