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!
Printable View
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!
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