• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set mnemonic key for JOptionPane.showOptionDialog

 
prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing following code for message box, but want to set mnemonic for OK and Cancel, is this possible? if yes please throw your suggestions.

Object[] options = { "OK", "CANCEL" };

JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning",
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
null, options, options[0]);

Thanks in advance

Prashant Gour
 
Nick Meverden
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for responce but that is not solution for me.
i want to set my own buttons on message box and want to Set mnemonic for those.Is that possible.

please let me know
~Prashant Gour
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks this is working fine but on action performed of both buton i want to dispose this dialog how can i dispose messge box.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!