/*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Vector;
import java.util.Enumeration;
import sun.awt.AWTAccessor;
import java.awt.peer.MenuBarPeer;
import java.awt.event.KeyEvent;
import javax.accessibility.*;
/**
* 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,
* {@link MenuBar#shortcuts} and
* {@link MenuBar#getShortcutMenuItem}
* that retrieve information about the shortcuts a given
* menu bar is managing.
*
* @author Sami Shaio
* @see java.awt.Frame
* @see java.awt.Frame#setMenuBar(java.awt.MenuBar)
* @see java.awt.Menu
* @see java.awt.MenuItem
* @see java.awt.MenuShortcut
* @since JDK1.0
*/
public class MenuBar extends MenuComponent implements MenuContainer, Accessible {
static {
/* ensure that the necessary native libraries are loaded */
Toolkit.loadLibraries();
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
AWTAccessor.setMenuBarAccessor(
new AWTAccessor.MenuBarAccessor() {
public Menu getHelpMenu(MenuBar menuBar) {
return menuBar.helpMenu;
}
public Vector