API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. Menu View Source
Author(s)
Sami Shaio
Since
JDK1.0
Version
1.78, 04/07/06
Serial
Hierarchy
 Object
      MenuComponent
          MenuItem
              Menu
Implements
 MenuContainer
 Accessible
Subclasses
Description
public class Menu
  A Menu object is a pull-down menu component that is deployed from a menu bar.
See also:    MenuItem CheckboxMenuItem
Constructors
public Menu () throws HeadlessException
  Constructs a new menu with an empty label.
public Menu (String label) throws HeadlessException
  Constructs a new menu with the specified label.
public Menu (String label, boolean tearOff) throws HeadlessException
  Constructs a new menu with the specified label, indicating whether the menu can be torn off.
Methods
Hide/Show inherited methods
public MenuItem add (MenuItem mi)
  Adds the specified menu item to this menu.
public void add (String label)
  Adds an item with the specified label to this menu.
publicsynchronized void addActionListener (ActionListener l) [Inherited From MenuItem]
  Adds the specified action listener to receive action events from this menu item.
public void addNotify () [Overrides MenuItem]
  Creates the menu's peer.
public void addSeparator ()
  Adds a separator line, or a hypen, to the menu at the current position.
pack-private String constructComponentName () [Overrides MenuItem]
  Construct a name for this MenuComponent.
@Deprecated
public int countItems ()
pack-privatefinal int countItemsImpl ()
public void deleteShortcut () [Inherited From MenuItem]
  Delete any MenuShortcut object associated with this menu item.
pack-private void deleteShortcut (MenuShortcut s) [Overrides MenuItem]
@Deprecated
publicsynchronized void disable () [Inherited From MenuItem]
protectedfinal void disableEvents (long eventsToDisable) [Inherited From MenuItem]
  Disables event delivery to this menu item for events defined by the specified event mask parameter.
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 void doMenuEvent (long when, int modifiers) [Inherited From MenuItem]
@Deprecated
publicsynchronized void enable () [Inherited From MenuItem]
@Deprecated
public void enable (boolean b) [Inherited From MenuItem]
protectedfinal void enableEvents (long eventsToEnable) [Inherited From MenuItem]
  Enables event delivery to this menu item for events to be defined by the specified event mask parameter
pack-private boolean eventEnabled (AWTEvent e) [Inherited From MenuItem]
pack-private int getAccessibleChildIndex (MenuComponent child) [Overrides MenuComponent]
  Defined in MenuComponent.
public AccessibleContext getAccessibleContext () [Overrides MenuItem] [Specified in Accessible]
  Gets the AccessibleContext associated with this Menu.
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.
public String getActionCommand () [Inherited From MenuItem]
  Gets the command name of the action event that is fired by this menu item.
pack-privatefinal String getActionCommandImpl () [Inherited From MenuItem]
publicsynchronized ActionListener getActionListeners () [Inherited From MenuItem]
  Returns an array of all the action listeners registered on this menu item.
pack-privatefinal Font getFont_NoClientCode () [Inherited From MenuComponent]
public Font getFont () [Inherited From MenuComponent]
  Gets the font used for this menu component.
public MenuItem getItem (int index)
  Gets the item located at the specified index of this menu.
public int getItemCount ()
  Get the number of items in this menu.
pack-privatefinal MenuItem getItemImpl (int index)
public String getLabel () [Inherited From MenuItem]
  Gets the label for this menu item.
public T getListeners (Class< T> listenerType) [Inherited From MenuItem]
  Returns an array of all the objects currently registered as FooListeners upon this MenuItem.
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 MenuShortcut getShortcut () [Inherited From MenuItem]
  Get the MenuShortcut object associated with this menu item,
pack-private MenuItem getShortcutMenuItem (MenuShortcut s) [Overrides MenuItem]
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) [Overrides MenuItem]
public void insert (MenuItem menuitem, int index)
  Inserts a menu item into this menu at the specified position.
public void insert (String label, int index)
  Inserts a menu item with the specified label into this menu at the specified position.
public void insertSeparator (int index)
  Inserts a separator at the specified position.
public boolean isEnabled () [Inherited From MenuItem]
  Checks whether this menu item is enabled.
public boolean isTearOff ()
  Indicates whether this menu is a tear-off menu.
public String paramString () [Overrides MenuItem]
  Returns a string representing the state of this Menu.
@Deprecated
public boolean postEvent (Event evt) [Inherited From MenuComponent]
  Posts the specified event to the menu.
protected void processActionEvent (ActionEvent e) [Inherited From MenuItem]
  Processes action events occurring on this menu item, by dispatching them to any registered ActionListener objects.
protected void processEvent (AWTEvent e) [Inherited From MenuItem]
  Processes events on this menu item.
public void remove (int index)
  Removes the menu item at the specified index from this menu.
public void remove (MenuComponent item) [Specified in MenuContainer]
  Removes the specified menu item from this menu.
publicsynchronized void removeActionListener (ActionListener l) [Inherited From MenuItem]
  Removes the specified action listener so it no longer receives action events from this menu item.
public void removeAll ()
  Removes all items from this menu.
public void removeNotify () [Overrides MenuComponent]
  Removes the menu's peer.
public void setActionCommand (String command) [Inherited From MenuItem]
  Sets the command name of the action event that is fired by this menu item.
publicsynchronized void setEnabled (boolean b) [Inherited From MenuItem]
  Sets whether or not this menu item can be chosen.
public void setFont (Font f) [Inherited From MenuComponent]
  Sets the font to be used for this menu component to the specified font.
publicsynchronized void setLabel (String label) [Inherited From MenuItem]
  Sets the label for this menu item to the specified label.
public void setName (String name) [Inherited From MenuComponent]
  Sets the name of the component to the specified string.
public void setShortcut (MenuShortcut s) [Inherited From MenuItem]
  Set the MenuShortcut object associated with this menu item.
pack-privatesynchronized Enumeration shortcuts ()
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-private String actionCommand [Inherited From MenuItem]
  This field indicates the command tha has been issued by a particular menu item.
pack-privatetransient ActionListener actionListener [Inherited From MenuItem]
pack-privatefinalstatic String actionListenerK = "actionL" [Inherited From MenuComponent]
pack-privatetransient sun.awt.AppContext appContext [Inherited From MenuComponent]
  The AppContext of the MenuComponent.
pack-private boolean enabled [Inherited From MenuItem]
  A value to indicate whether a menu item is enabled or not.
pack-private long eventMask [Inherited From MenuItem]
  The eventMask is ONLY set by subclasses via enableEvents.
pack-private Font font [Inherited From MenuComponent]
  The menu component's font.
pack-private boolean isHelpMenu
  This field will be set to true if the Menu in question is actually a help menu.
pack-privatefinalstatic String itemListenerK = "itemL" [Inherited From MenuComponent]
pack-private Vector items
  A vector of the items that will be part of the Menu.
pack-private String label [Inherited From MenuItem]
  label is the label of a menu item.
pack-private boolean newEventsOnly [Inherited From MenuComponent]
  Defaults to false.
pack-privatetransient MenuContainer parent [Inherited From MenuComponent]
pack-privatetransient MenuComponentPeer peer [Inherited From MenuComponent]
pack-private boolean tearOff
  This field indicates whether the menu has the tear of property or not.
Nested Classes
  Menu.AccessibleAWTMenu
Inner class of Menu used to provide default support for accessibility.
  MenuItem.AccessibleAWTMenuItem
Inner class of MenuItem 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