K
Koos Pol
Hi cljp,
I've hammered my brains on it but I can't seem so figure out why this dialog
doesn't close after pressing "Save", or "OK".
What do I need to do to auto close this dialog after pressing a button?
JButton fooButton = new JButton("Foo!");
JButton barButton = new JButton("Bar!");
JOptionPane pane = new JOptionPane();
pane.setInitialValue(fooButton);
pane.setMessage("Foo & Bar");
pane.setMessageType(JOptionPane.PLAIN_MESSAGE);
pane.setOptions(new JButton[] {fooButton, barButton} );
JDialog dialog = pane.createDialog(null, "Foobar");
dialog.setVisible(true);
BTW, I've not chosen the showXXXdialog version for flexibility reasons not
shown here.
Thanks,
Koos
I've hammered my brains on it but I can't seem so figure out why this dialog
doesn't close after pressing "Save", or "OK".
What do I need to do to auto close this dialog after pressing a button?
JButton fooButton = new JButton("Foo!");
JButton barButton = new JButton("Bar!");
JOptionPane pane = new JOptionPane();
pane.setInitialValue(fooButton);
pane.setMessage("Foo & Bar");
pane.setMessageType(JOptionPane.PLAIN_MESSAGE);
pane.setOptions(new JButton[] {fooButton, barButton} );
JDialog dialog = pane.createDialog(null, "Foobar");
dialog.setVisible(true);
BTW, I've not chosen the showXXXdialog version for flexibility reasons not
shown here.
Thanks,
Koos