Packages This Package Prev Next Index
public class java.awt.CheckboxMenuItem extends java.awt.MenuItem (II-§1.32) { // Constructors public CheckboxMenuItem(String label); §1.7.1 // Methods public void addNotify(); §1.7.2 public boolean getState(); §1.7.3 public String paramString(); §1.7.4 public void setState(boolean t); §1.7.5 }This class represents a check box that can be included in a menu. Clicking on the check box in the menu changes its state from "on" to "off" or from "off" to "on".
The picture of a menu bar (page II-188) shows five menu items. The item labeled Check shows a check box menu item in its "off" state.
When a check box menu item is clicked, the AWT sends an action event (II-§1.14.11) to the check box menu item's containing frame. The event's target is the check box menu item, and its object is the string label of the check box.
public CheckboxMenuItem(String label)
label
-
a string label for the check box menu item, or null for an
unlabeled menu item
public void addNotify()
public boolean getState()
public String paramString()
public void setState(boolean state)
state
-
the boolean state of this check box menu item
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)