API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. MenuItem View Source
Author(s)
Sami Shaio
Since
Version
1.94, 07/11/06
Serial
Hierarchy
 Object
      MenuComponent
          MenuItem
Implements
 Accessible
Subclasses
Description
public class MenuItem
  All items in a menu must belong to the class MenuItem, or one of its subclasses.
See also:   
Constructors
public MenuItem () throws HeadlessException
  Constructs a new MenuItem with an empty label and no keyboard shortcut.
public MenuItem (String label) throws HeadlessException
  Constructs a new MenuItem with the specified label and no keyboard shortcut.
public MenuItem (String label, MenuShortcut s) throws HeadlessException
  Create a menu item with an associated keyboard shortcut.
Methods
Hide/Show inherited methods
publicsynchronized void addActionListener (ActionListener l)
  Adds the specified action listener to receive action events from this menu item.
public void addNotify ()
  Creates the menu item's peer.
pack-private String constructComponentName () [Overrides MenuComponent]
  Construct a name for this MenuComponent.
public void deleteShortcut ()
  Delete any MenuShortcut object associated with this menu item.
pack-private void deleteShortcut (MenuShortcut s)
@Deprecated
publicsynchronized void disable ()
protectedfinal void disableEvents (long eventsToDisable)
  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)
@Deprecated
publicsynchronized void enable ()
@Deprecated
public void enable (boolean b)
protectedfinal void enableEvents (long eventsToEnable)
  Enables event delivery to this menu item for events to be defined by the specified event mask parameter
pack-private boolean eventEnabled (AWTEvent e) [Overrides MenuComponent]
pack-private int getAccessibleChildIndex (MenuComponent child) [Inherited From MenuComponent]
  Gets the index of the child within this MenuComponent.
public AccessibleContext getAccessibleContext () [Overrides MenuComponent] [Specified in Accessible]
  Gets the AccessibleContext associated with this MenuItem.
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 ()
  Gets the command name of the action event that is fired by this menu item.
pack-privatefinal String getActionCommandImpl ()
publicsynchronized ActionListener getActionListeners ()
  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 String getLabel ()
  Gets the label for this menu item.
public T getListeners (Class< T> listenerType)
  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 ()
  Get the MenuShortcut object associated with this menu item,
pack-private MenuItem getShortcutMenuItem (MenuShortcut s)
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)
public boolean isEnabled ()
  Checks whether this menu item is enabled.
public String paramString () [Overrides MenuComponent]
  Returns a string representing the state of this MenuItem.
@Deprecated
public boolean postEvent (Event evt) [Inherited From MenuComponent]
  Posts the specified event to the menu.
protected void processActionEvent (ActionEvent e)
  Processes action events occurring on this menu item, by dispatching them to any registered ActionListener objects.
protected void processEvent (AWTEvent e) [Overrides MenuComponent]
  Processes events on this menu item.
publicsynchronized void removeActionListener (ActionListener l)
  Removes the specified action listener so it no longer receives action events from this menu item.
public void removeNotify () [Inherited From MenuComponent]
  Removes the menu component's peer.
public void setActionCommand (String command)
  Sets the command name of the action event that is fired by this menu item.
publicsynchronized void setEnabled (boolean b)
  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)
  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)
  Set the MenuShortcut object associated with this menu item.
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
  This field indicates the command tha has been issued by a particular menu item.
pack-privatetransient ActionListener actionListener
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
  A value to indicate whether a menu item is enabled or not.
pack-private long eventMask
  The eventMask is ONLY set by subclasses via enableEvents.
pack-private Font font [Inherited From MenuComponent]
  The menu component's font.
pack-privatefinalstatic String itemListenerK = "itemL" [Inherited From MenuComponent]
pack-private String label
  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]
Nested Classes
  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