API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. MenuBar View Source
Author(s)
Sami Shaio
Since
JDK1.0
Version
1.72, 04/18/06
Serial
Hierarchy
 Object
      MenuComponent
          MenuBar
Implements
 MenuContainer
 Accessible
Subclasses
Description
public class MenuBar
  The MenuBar class encapsulates the platform's concept of a menu bar bound to a frame.
Constructors
public MenuBar () throws HeadlessException
  Creates a new menu bar.
Methods
Hide/Show inherited methods
public Menu add (Menu m)
  Adds the specified menu to the menu bar.
public void addNotify ()
  Creates the menu bar's peer.
pack-private String constructComponentName () [Overrides MenuComponent]
  Construct a name for this MenuComponent.
@Deprecated
public int countMenus ()
public void deleteShortcut (MenuShortcut s)
  Deletes the specified menu shortcut.
publicfinal void dispatchEvent (AWTEvent e) [Inherited From MenuComponent]
  Delivers an event to this component or one of its sub components.
pack-private void dispatchEventImpl (AWTEvent e) [Inherited From MenuComponent]
pack-private boolean eventEnabled (AWTEvent e) [Inherited From MenuComponent]
pack-private int getAccessibleChildIndex (MenuComponent child) [Overrides MenuComponent]
  Defined in MenuComponent.
public AccessibleContext getAccessibleContext () [Overrides MenuComponent] [Specified in Accessible]
  Gets the AccessibleContext associated with this MenuBar.
pack-private int getAccessibleIndexInParent () [Inherited From MenuComponent]
  Gets the index of this object in its accessible parent.
pack-private AccessibleStateSet getAccessibleStateSet () [Inherited From MenuComponent]
  Gets the state of this object.
pack-privatefinal Font getFont_NoClientCode () [Inherited From MenuComponent]
public Font getFont () [Inherited From MenuComponent]
  Gets the font used for this menu component.
public Menu getHelpMenu ()
  Gets the help menu on the menu bar.
public Menu getMenu (int i)
  Gets the specified menu.
public int getMenuCount ()
  Gets the number of menus on the menu bar.
pack-privatefinal int getMenuCountImpl ()
pack-privatefinal Menu getMenuImpl (int i)
public String getName () [Inherited From MenuComponent]
  Gets the name of the menu component.
pack-privatefinal MenuContainer getParent_NoClientCode () [Inherited From MenuComponent]
public MenuContainer getParent () [Inherited From MenuComponent]
  Returns the parent container for this menu component.
@Deprecated
public MenuComponentPeer getPeer () [Inherited From MenuComponent]
public MenuItem 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.
protectedfinal Object getTreeLock () [Inherited From MenuComponent]
  Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations.
pack-private boolean handleShortcut (KeyEvent e)
protected String paramString () [Inherited From MenuComponent]
  Returns a string representing the state of this MenuComponent.
@Deprecated
public boolean postEvent (Event evt) [Inherited From MenuComponent]
  Posts the specified event to the menu.
protected void processEvent (AWTEvent e) [Inherited From MenuComponent]
  Processes events occurring on this menu component.
public void remove (int index)
  Removes the menu located at the specified index from this menu bar.
public void remove (MenuComponent m) [Specified in MenuContainer]
  Removes the specified menu component from this menu bar.
public void removeNotify () [Overrides MenuComponent]
  Removes the menu bar's peer.
public void setFont (Font f) [Inherited From MenuComponent]
  Sets the font to be used for this menu component to the specified font.
public void setHelpMenu (Menu m)
  Sets the specified menu to be this menu bar's help menu.
public void setName (String name) [Inherited From MenuComponent]
  Sets the name of the component to the specified string.
publicsynchronized Enumeration<MenuShortcut> shortcuts ()
  Gets an enumeration of all menu shortcuts this menu bar is managing.
public String toString () [Inherited From MenuComponent]
  Returns a representation of this menu component as a string.
Fields
Hide/Show inherited fields
pack-private AccessibleContext accessibleContext [Inherited From MenuComponent]
pack-privatefinalstatic String actionListenerK = "actionL" [Inherited From MenuComponent]
pack-privatetransient sun.awt.AppContext appContext [Inherited From MenuComponent]
  The AppContext of the MenuComponent.
pack-private Font font [Inherited From MenuComponent]
  The menu component's font.
pack-private Menu helpMenu
  This menu is a special menu dedicated to help.
pack-privatefinalstatic String itemListenerK = "itemL" [Inherited From MenuComponent]
pack-private Vector menus
  This field represents a vector of the actual menus that will be part of the MenuBar.
pack-private boolean newEventsOnly [Inherited From MenuComponent]
  Defaults to false.
pack-privatetransient MenuContainer parent [Inherited From MenuComponent]
pack-privatetransient MenuComponentPeer peer [Inherited From MenuComponent]
Nested Classes
  MenuBar.AccessibleAWTMenuBar
Inner class of MenuBar used to provide default support for accessibility.
  MenuComponent.AccessibleAWTMenuComponent
Inner class of MenuComponent used to provide default support for accessibility.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar