|
-
May 10th, 2010, 10:42 PM
#1
Set F1 as the shortcut to a help menu
Hi,
I was making a menu bar for my JFrame, which contains a menu item named "Help".
I'm wondering how to make F1 a shortcut to that menu item. I thought of using .setAccelorator()., but that didn't seem to work.
So can you show me how?
Thanks!
-
May 11th, 2010, 03:44 AM
#2
Re: Set F1 as the shortcut to a help menu
 Originally Posted by oontvoo
I'm wondering how to make F1 a shortcut to that menu item. I thought of using .setAccelorator()., but that didn't seem to work.
Setting an accelerator on the action should work - that's what they're for. Show us the code you tried that doesn't work.
You could set a mnemonic (see Menu - Enabling Keyboard Operation), but that's not quite the same thing.
Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise...
E. Dijkstra
Last edited by dlorde; May 11th, 2010 at 03:48 AM.
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|