Class java.awt.MenuItem
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.MenuItem

java.lang.Object
   |
   +----java.awt.MenuComponent
           |
           +----java.awt.MenuItem

public class MenuItem
extends MenuComponent
A String item that represents a choice in a menu.

Constructor Index

 o MenuItem(String)
Constructs a new MenuItem with the specified label.

Method Index

 o addNotify()
Creates the menu item's peer.
 o disable()
Makes this menu item unselectable by the user.
 o enable()
Makes this menu item selectable by the user.
 o enable(boolean)
Conditionally enables a component.
 o getLabel()
Gets the label for this menu item.
 o isEnabled()
Checks whether the menu item is enabled.
 o paramString()
Returns the String parameter of the menu item.
 o setLabel(String)
Sets the label to be the specified label.

Constructors

 o MenuItem
  public MenuItem(String label)
Constructs a new MenuItem with the specified label.
Parameters:
label - the label for this menu item. Note that "-" is reserved to mean a separator between menu items.

Methods

 o addNotify
  public synchronized void addNotify()
Creates the menu item's peer. The peer allows us to modify the appearance of the menu item without changing its functionality.
 o getLabel
  public String getLabel()
Gets the label for this menu item.
 o setLabel
  public void setLabel(String label)
Sets the label to be the specified label.
Parameters:
label - the label for this menu item
 o isEnabled
  public boolean isEnabled()
Checks whether the menu item is enabled.
 o enable
  public void enable()
Makes this menu item selectable by the user.
 o enable
  public void enable(boolean cond)
Conditionally enables a component.
Parameters:
cond - enabled if true; disabled otherwise.
See Also:
enable, disable
 o disable
  public void disable()
Makes this menu item unselectable by the user.
 o paramString
  public String paramString()
Returns the String parameter of the menu item.
Overrides:
paramString in class MenuComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index