Um, how do you do this …using Actions?
It’s one of those many evil parts of AWT/swing design where it’s like learning French - the most frequently-used stuff to seems to be the most deviating from all the rules :(.
What I do know is this:
- Actions which register themselves as using CTRL + C or V as their ACCELERATOR_KEY get silently ignored. But if you use any other CTRL combination, it works as a global shortcut.
- I can’t see anything in the Action docs as to why this happens (or even any indication that it happens). In fact, the AbstractAction docs even use “Cut” as an example (haven’t checked, but I’m guessing Ctrl-X does nothing too?)
- …but I also can’t see what the difference is between ACCELERATOR_KEY and ACTION_COMMAND_KEY.
- …except that if you attempt to put a value of Ctrl-C for ACTION_COMMAND_KEY, you crash swing’s AbstractAction class. It dies with an internal ClassCastException. Great!


?) and am probably misunderstanding a lot of it :(.