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.
-
MenuItem(String)
-
Constructs a new MenuItem with the specified label.
-
addNotify()
- Creates the menu item's peer.
-
disable()
- Makes this menu item unselectable by the user.
-
enable()
- Makes this menu item selectable by the user.
-
enable(boolean)
- Conditionally enables a component.
-
getLabel()
- Gets the label for this menu item.
-
isEnabled()
- Checks whether the menu item is enabled.
-
paramString()
- Returns the String parameter of the menu item.
-
setLabel(String)
- Sets the label to be the specified label.
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.
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.
getLabel
public String getLabel()
- Gets the label for this menu item.
setLabel
public void setLabel(String label)
- Sets the label to be the specified label.
- Parameters:
- label - the label for this menu item
isEnabled
public boolean isEnabled()
- Checks whether the menu item is enabled.
enable
public void enable()
- Makes this menu item selectable by the user.
enable
public void enable(boolean cond)
- Conditionally enables a component.
- Parameters:
- cond - enabled if true; disabled otherwise.
- See Also:
- enable, disable
disable
public void disable()
- Makes this menu item unselectable by the user.
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