• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to put contol keys (F2,F3 etc)for a jButton  RSS feed

 
reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to put control keys for buttons in my frame.i can able to put those for menu options, but i am not able to put for jButtons?
pleaze help me on this issue
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Just use the JButton setMnemonic method. For example:
b1.setMnemonic(KeyEvent.VK_F1);
will let you use F1 key for the button b1.
NOTE: Your name is not a valid one for the Ranch. We would prefer a first name + space + last name to keep professional. Please read the Ranch naming policy here and re-register with an appropriate name.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!