File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Show a PopupMenu using a hotkey Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Show a PopupMenu using a hotkey" Watch "Show a PopupMenu using a hotkey" New topic

Show a PopupMenu using a hotkey

Mohit J Kumar
Ranch Hand

Joined: Apr 08, 2010
Posts: 33

Hi all,
Is it possible to show a popup menu using a hotkey like "Alt Shift a"?
I have a table on which I am able to display a popup menu on right click.
I want to do it using some hotkey.

"It's good to B in touch...So keep responding"
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
Can you add a KeyListener or similar to your table? The underlined text leads to some links which look helpful.
Darryl Burke

Joined: May 03, 2008
Posts: 5115

You can also use key bindings, which give you more flexibility than a KeyListener.
The component's window either has the focus or contains the component that has the focus. This input map is commonly used for mnemonics or accelerators, which need to be active regardless of where focus is in the window.

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: Show a PopupMenu using a hotkey
jQuery in Action, 3rd edition