|Java TM Look and Feel Design Guidelines: Advanced Topics > Part I: General Topics > 3: Menus > Contextual Menus||
A contextual menu is a menu displayed when a user presses mouse button 2 while the pointer is over an object or area associated with that menu. Contextual menus are one of two main types of menus--the other type being drop-down menus, which users choose from a menu bar. Figure 33 shows a contextual menu.Figure 33 Contextual Menu (Displayed Over a Table)
The correct menu items for a contextual menu depend on where the pointer is when a user opens that menu. Table 7 describes the correct types of menu items for contextual menus opened from various pointer positions.
|Pointer Position When Menu Opens||Correct Menu Items|
|Not on an object or selection||
|On a single object that is not selected||
|On a selection||
Some objects have a default command , executed if a user double-clicks the object. When displaying the contextual menu for such an object, use bold to display the menu item that activates the default command. For an example, see Figure 33, in which Open is the default command.
The following guidelines help you design contextual menus. These guidelines supplement those in Chapter 9 of Java Look and Feel Design Guidelines , 2d ed.
Provide contextual menus only as conveniences that are redundant with other controls--typically with items in your application's drop-down menus. Each item in a contextual menu must be available elsewhere in your application.
In a contextual menu for a selection, ensure that each menu item that operates on an object can be applied to each object in the selection. (That is, ensure that the set of menu items for the selected objects is an intersection, not a union.)
When designing contextual menus, follow the rules in Table 7.
|Java Look and Feel Design Guidelines: Advanced Topics.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.