daileyps
September 19th, 2000, 02:57 PM
If I create a dialog box:
int result = JOptionPane.showOptionDialog(MyApp.this, dlgObjects, "MyDialog", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, dlgOptions, dlgOptions[0]);
where dlgObjects are simply my objects (labels, text boxes) and dlgOptions are my buttons:
private Object[] dlgOptions = { "Save", "Cancel") };
How do I:
a) setMnemonic on the two option buttons?
b) trap for enter key and invoke the button with focus?
Thanks in advance :-)
int result = JOptionPane.showOptionDialog(MyApp.this, dlgObjects, "MyDialog", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, dlgOptions, dlgOptions[0]);
where dlgObjects are simply my objects (labels, text boxes) and dlgOptions are my buttons:
private Object[] dlgOptions = { "Save", "Cancel") };
How do I:
a) setMnemonic on the two option buttons?
b) trap for enter key and invoke the button with focus?
Thanks in advance :-)