java.awt
Class CheckboxMenuItem

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

public class CheckboxMenuItem
extends MenuItem

This class produces a checkbox that represents a choice in a menu.


Constructor Summary
CheckboxMenuItem(String label)
          Creates the checkbox item with the specified label.
 
Method Summary
 void addNotify()
          Creates the peer of the checkbox item.
 boolean getState()
          Returns the state of this MenuItem.
 String paramString()
          Returns the parameter String of this button.
 void setState(boolean t)
          Sets the state of this MenuItem if it is a Checkbox.
 
Methods inherited from class java.awt.MenuItem
disable, enable, enable, getLabel, isEnabled, setLabel
 
Methods inherited from class java.awt.MenuComponent
getFont, getParent, getPeer, postEvent, removeNotify, setFont, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CheckboxMenuItem

public CheckboxMenuItem(String label)
Creates the checkbox item with the specified label.

Parameters:
label - the button label
Method Detail

addNotify

public void addNotify()
Creates the peer of the checkbox item. This peer allows us to change the look of the checkbox item without changing its functionality.

Overrides:
addNotify in class MenuItem

getState

public boolean getState()
Returns the state of this MenuItem. This method is only valid for a Checkbox.


setState

public void setState(boolean t)
Sets the state of this MenuItem if it is a Checkbox.

Parameters:
t - the specified state of the checkbox

paramString

public String paramString()
Returns the parameter String of this button.

Overrides:
paramString in class MenuItem