I've got a little problem with accelerator keys. I've got an JApplet with a standard edit menu containing menu items like cut, copy & paste.
Concerning the paste action I've defined a class CustomPasteAction which does some extra checking before pasting the currently copied (or cut) text.
JMenuItem jmiPaste = new JMenuItem(new CustomPasteAction());
In addition I've defined a keyboard shortcut for Ctrl+V to invoke that action with:
jmiPaste.setAccelerator(KeyStroke.getKeyStroke('V', java.awt.Event.CTRL_MASK, false));
The problem I got is that when I use the keyboard shortcuts, another paste action than the one I registered for that shortcut is invoked. When I use the menu-entries themselves (slow working by clicking Edit > Paste) - my CustomPasteAction gets invoked.
Does anybody have an idea why's that and how I can disable the preregistered paste actions (if there are any)?
I'm really stuck with that for some time now. Any help is greatly appreciated.
-- planning is the substitution of hazard by error --