O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Menu Shortcuts

Menu shortcuts provide the ability to activate a menu item by using the keyboard. Menu shortcuts are also known as menu accelerators or keyboard equivalents. Shortcuts have a key modifier that varies among between platforms:

  • Macintosh: <Command>

  • Windows 95: <Control>

  • Motif: <Control>

The java.awt.Toolkit class provides a method that returns the appropriate modifier—Toolkit.getMenuShortcutKeyMask()—should you ever have the need to programmatically determine the modifier key on a particular platform.

Menu items must provide some kind of visual indication that a shortcut may be used to activate the menu item, when applicable. Such visual indication varies among between platforms and is handled in a platform-dependent manner by the AWT. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required