Java TM Look and Feel Design Guidelines: Advanced Topics > Part I: General Topics > 3: Menus > Menu Elements   Previous Next Contents/Index/Search


Menu Elements

Figure 22 shows menus elements in a typical application.

Figure 22   Menu Elements


In Figure 22:

  • Each menu title consists of exactly one word.
  • The menu titles fit in a single line in the menu bar.
  • The command name in each menu item is a single word or a short phrase, such as "Save As."
  • No menu item has a command name identical to the menu's title. (For example, no item in the File menu is labeled "File.")
  • All menu titles and menu items use headline capitalization style. (For more information about headline capitalization, see Chapter 4 of Java Look and Feel Design Guidelines , 2d ed.)

Menu elements in most applications should have these characteristics, each of which promotes usability.

 When a window is at its default size, ensure that the titles of its drop-down menus all fit on a single line in the menu bar, without being truncated.

 Ensure that the title of a drop-down menu consists of exactly one word.

 In drop-down menus, ensure that the label of each menu item differs from the menu title.

Keyboard Shortcuts and Mnemonics for Menu Items

Keyboard shortcuts and mnemonics are keyboard equivalents to menu items.

  • A keyboard shortcut is a keystroke combination (usually a modifier key and a character key, like Control-C) that activates a menu item from the keyboard, even if the relevant menu is not currently displayed.
  • A mnemonic is an underlined alphanumeric character in a menu title or menu item. A mnemonic shows a user which key to press (sometimes in conjunction with the Alt key) to activate a menu item or navigate to it.

An item's mnemonic differs from its keyboard shortcut. Figure 22 shows mnemonics and keyboard shortcuts for items in a typical File menu.

Table 5 lists mnemonics for typical menus and menu items. To use the mnemonics in Table 5, users can simultaneously press the Alt key and the character key that corresponds to the underlined letter or numeral. (For more information, see Chapter 6 of Java Look and Feel Design Guidelines , 2d ed.)


Menu Title Menu Items
File New, Ne w Window, Open, Open in New Win dow, Open in Curren t Window, Close, Save, S ave As, Page Set up, Print, P references, File  Prop erties 1 , E xit
Edit Undo, Redo, Cu t, Copy, Paste, Delete, Find, Fi nd Again, Select  All
Fo rmat Bold, Italic, Underline, Align  Left, Align  Center, Align  Right
View Lar ge Icons, S mall Icons, List, Details, Sort By, Filter, Zoom In, Zoom  Out, Refresh
Help Contents, Tutorial, Index, Search, About  Application-Name
1 Assign "e" as the mnemonic for the File Prop erties item only if the name represented by File contains no
better letter for the mnemonic.

Table 6 lists common keyboard shortcuts.


Sequence Equivalent Menu Item
Ctrl-N New (File menu)
Ctrl-O Open (File menu)
Ctrl-W Close (File menu)
Ctrl-S Save (File menu)
Ctrl-P Print (File menu)
Ctrl-Z Undo (Edit menu)
Ctrl-Y Redo (Edit menu)
Ctrl-X Cut (Edit menu)
Ctrl-C Copy (Edit menu)
Ctrl-V Paste (Edit menu)
Delete Delete (Edit menu)
Ctrl-F Find (Edit menu)
Ctrl-G Find Again (Edit menu)
Ctrl-H Replace (Edit menu)
Ctrl-A Select All (Edit menu)
Ctrl-B Bold (Format menu)
Ctrl-I Italic (Format menu)
Ctrl-U Underline (Format menu)
Ctrl-J Justify (Format menu)
Ctrl-L Align Left (Format menu)
Ctrl-E Align Center (Format menu)
Ctrl-R Align Right (Format menu)
F1 Help
Shift-F1 Contextual help
F10 Refresh

For more information about keyboard shortcuts and mnemonics, see those topics in Chapter 6 of Java Look and Feel Design Guidelines , 2d ed. and elsewhere in that book.

 Assign mnemonics to all menu titles and menu items. Use the mnemonics in Table 5 if your application includes any of the menu titles and menu items listed there.

 Provide keyboard shortcuts for frequently used menu items. Use the keyboard shortcuts in Table 6, if possible.  

Available and Unavailable Items

A menu item is dimmed when its command is unavailable. In Figure 23, the Paste and Paste Special items are unavailable and, therefore, dimmed.

Figure 23   Menu With Unavailable Items


 Dim a menu item if it represents an unavailable command, and users can make that command available without exiting the application. If the command becomes available, undim the menu item. (For more information on available and unavailable menu items, see Chapter 9 of Java Look and Feel Design Guidelines , 2d ed.)

Additional Conventions for Menu Items

Like the conventions described so far in this chapter, the following conventions help users to work with menus.


You can group menu items by inserting separators between groups. In Figure 23, the Undo and Redo items of the Edit menu are a group, set apart from the menu's other groups by a separator.


An ellipsis (...) at the end of a menu item indicates that an application needs additional user input to execute the item's command. An ellipsis indicates that the application will display a dialog box before executing the command. However, not all menu items that open additional windows should have an ellipsis. For example, the About item in a Help menu should not end in an ellipsis.

 Place an ellipsis (...) at the end of a menu item only if that item opens a dialog box that requests user input for completing an action.

 Do not place an ellipsis (...) after a menu item that opens a property window.

Menu Item Graphics

You can place graphics before the leading edge of menu items, as in Figure 22.

 Provide menu item graphics only if there are corresponding toolbar button graphics in your application. The graphics help users associate the toolbar button with the corresponding menu command. Provide menu item graphics for all the qualified menu items or for none of them.

   The recommended menu graphics are at the following web site:

Java Look and Feel Design Guidelines: Advanced Topics.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.
Previous Next Contents/Index/Search
Table 6   Common Keyboard Shortcuts 
Table 5   Common Mnemonics 
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)