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

Class java.awt.Checkbox

java.lang.Object
|
   +----java.awt.Component
|
           +----java.awt.Checkbox

public class Checkbox
extends Component
A Checkbox object is a graphical user interface element that has a boolean state.

Constructor Index

 o Checkbox()
Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.
 o Checkbox(String)
Constructs a Checkbox with the specified label, no Checkbox group, and initialized to a false state.
 o Checkbox(String, CheckboxGroup, boolean)
Constructs a Checkbox with the specified label, specified Checkbox group, and specified boolean state.

Method Index

 o addNotify()
Creates the peer of the Checkbox.
 o getCheckboxGroup()
Returns the checkbox group.
 o getLabel()
Gets the label of the button.
 o getState()
Returns the boolean state of the Checkbox.
 o paramString()
Returns the parameter String of this Checkbox.
 o setCheckboxGroup(CheckboxGroup)
Sets the CheckboxGroup to the specified group.
 o setLabel(String)
Sets the button with the specified label.
 o setState(boolean)
Sets the Checkbox to the specifed boolean state.

Constructors

 o Checkbox
public Checkbox()
Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.
 o Checkbox
public Checkbox(String label)
Constructs a Checkbox with the specified label, no Checkbox group, and initialized to a false state.
Parameters:
label - the label on the Checkbox
 o Checkbox
public Checkbox(String label,
CheckboxGroup group,
                  boolean state)
Constructs a Checkbox with the specified label, specified Checkbox group, and specified boolean state. If the specified CheckboxGroup is not equal to null, then this Checkbox becomes a Checkbox button. If the Checkbox becomes a button, this simply means that only one Checkbox in a CheckboxGroup may be set at a time.
Parameters:
label - the label on the Checkbox
group - the CheckboxGroup this Checkbox is in
state - is the initial state of this Checkbox

Methods

 o addNotify
public synchronized void addNotify()
Creates the peer of the Checkbox. The peer allows you to change the look of the Checkbox without changing its functionality.
Overrides:
addNotify in class Component
 o getLabel
public String getLabel()
Gets the label of the button.
See Also:
setLabel
 o setLabel
public void setLabel(String label)
Sets the button with the specified label.
Parameters:
label - the label of the button
See Also:
getLabel
 o getState
public boolean getState()
Returns the boolean state of the Checkbox.
See Also:
setState
 o setState
public void setState(boolean state)
Sets the Checkbox to the specifed boolean state.
Parameters:
state - the boolean state
See Also:
getState
 o getCheckboxGroup
public CheckboxGroup getCheckboxGroup()
Returns the checkbox group.
See Also:
setCheckboxGroup
 o setCheckboxGroup
public void setCheckboxGroup(CheckboxGroup g)
Sets the CheckboxGroup to the specified group.
Parameters:
g - the new CheckboxGroup
See Also:
getCheckboxGroup
 o paramString
protected String paramString()
Returns the parameter String of this Checkbox.
Overrides:
paramString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index