How to do system short cuts cross platform integration in Java?

The Toolkit method getMenuShortcutKeyMask() is useful in this context. While the method returns Event.CTRL_MASK on Windows, it returns Event.META_MASK on Mac OS X. The resulting mask can be used to construct the KeyStroke used in a menu item’s setAccelerator() method.

Leave a Comment