The MenuBar class encapsulates the platform's
concept of a menu bar bound to a frame. In order to associate
the menu bar with a Frame object, call the
frame's setMenuBar method.
This is what a menu bar might look like:
A menu bar handles keyboard shortcuts for menu items, passing them
along to its child menus.
(Keyboard shortcuts, which are optional, provide the user with
an alternative to the mouse for invoking a menu item and the
action that is associated with it.)
Each menu item can maintain an instance of MenuShortcut.
The MenuBar class defines several methods,
MenuBar.shortcuts and
MenuBar.getShortcutMenuItem that retrieve information about the shortcuts a given
menu bar is managing.
version: 1.79, 05/05/07 author: Sami Shaio See Also:java.awt.Frame See Also:java.awt.Frame.setMenuBar(java.awt.MenuBar) See Also:java.awt.Menu See Also:java.awt.MenuItem See Also:java.awt.MenuShortcut since: JDK1.0
Inner Class :protected class AccessibleAWTMenuBar extends AccessibleAWTMenuComponent
getShortcutMenuItem(MenuShortcut s) Gets the instance of MenuItem associated
with the specified MenuShortcut object,
or null if none of the menu items being managed
by this menu bar is associated with the specified menu
shortcut.
This menu is a special menu dedicated to
help. The one thing to note about this menu
is that on some platforms it appears at the
right edge of the menubar.
See Also:MenuBar.getHelpMenu() See Also:MenuBar.setHelpMenu(Menu)
Gets the AccessibleContext associated with this MenuBar.
For menu bars, the AccessibleContext takes the form of an
AccessibleAWTMenuBar.
A new AccessibleAWTMenuBar instance is created if necessary.
an AccessibleAWTMenuBar that serves as the AccessibleContext of this MenuBar since: 1.3
Gets the instance of MenuItem associated
with the specified MenuShortcut object,
or null if none of the menu items being managed
by this menu bar is associated with the specified menu
shortcut.
Parameters: s - the specified menu shortcut. See Also:java.awt.MenuItem See Also:java.awt.MenuShortcut since: JDK1.1
Removes the menu located at the specified
index from this menu bar.
Parameters: index - the position of the menu to be removed. See Also:java.awt.MenuBar.add(java.awt.Menu)
Removes the specified menu component from this menu bar.
Parameters: m - the menu component to be removed. See Also:java.awt.MenuBar.add(java.awt.Menu)
Sets the specified menu to be this menu bar's help menu.
If this menu bar has an existing help menu, the old help menu is
removed from the menu bar, and replaced with the specified menu.
Parameters: m - the menu to be set as the help menu
Gets an enumeration of all menu shortcuts this menu bar
is managing.
an enumeration of menu shortcuts that thismenu bar is managing. See Also:java.awt.MenuShortcut since: JDK1.1