• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add a Shortcut to menu or menuItem  RSS feed

 
Ranch Hand
Posts: 95
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me how to add a menu or menuitem shortcut in awt gui.
Please give me a example or any link where a i can found a example.
Thanks in Advanced
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the API for JMenuItem, particular the method setAccelerator JMenuItem
You can use this methode to generate a shortcut.
For example

This generate a menuItem 'exit' with the shortcut key CTRL X.
Marcel
 
Get out of my mind! Look! A tiny ad!
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!