posted 11 years ago
I've added a JPopupMenu to a JPanel with a TextArea in it. The popup menu is attached to the TextArea with the usual MouseListener.
To bring up the popup menu with a keystroke, I've gotten the InputMap and added a (key, action) pair to it. The key is an alt P, the action is a defined Action instance.
The software works fine in popping up the menu and closing the menu. Alas, if the focus is on the text area, alt p ALSO produces a "pi" symbol in the text area.
The Action class uses an ActionEvent that doesn't have a consume() method. What sort of action for the ActionMap should I be using so that I can consume the alt P?
Thanks,
Chris
Here's a snippet :