• Post Reply Bookmark Topic Watch Topic
  • New Topic

mnemonci keys in JoptionPane

 
aminur rashid
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can i add mnemonci keys to buttons in JOptionPane.
I can make an option pane as
Object [] options = {"Come", "Go"};
int action = JOptionPane.showOptionDialog(null, "What you want to do?", "Way out!", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
now i want mnemonic keys for come and go buttons.Can I do it?if yes can u tell me plz?
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
instead of a string array you can provide an JButton array with the buttons that have the desired mnemonic setting.
note that you will have to trigger the events yourself in this case. see:
http://developer.java.sun.com/developer/bugParade/bugs/4813436.html
cheers,
Chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!