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.
- Checkbox()
- Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.
- Checkbox(String)
- Constructs a Checkbox with the specified label, no Checkbox group, and initialized to a false state.
- Checkbox(String, CheckboxGroup, boolean)
- Constructs a Checkbox with the specified label, specified Checkbox group, and specified boolean state.
- addNotify()
- Creates the peer of the Checkbox.
- getCheckboxGroup()
- Returns the checkbox group.
- getLabel()
- Gets the label of the button.
- getState()
- Returns the boolean state of the Checkbox.
- paramString()
- Returns the parameter String of this Checkbox.
- setCheckboxGroup(CheckboxGroup)
- Sets the CheckboxGroup to the specified group.
- setLabel(String)
- Sets the button with the specified label.
- setState(boolean)
- Sets the Checkbox to the specifed boolean state.
Checkbox
public Checkbox()
- Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.
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
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
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
getLabel
public String getLabel()
- Gets the label of the button.
- See Also:
- setLabel
setLabel
public void setLabel(String label)
- Sets the button with the specified label.
- Parameters:
- label - the label of the button
- See Also:
- getLabel
getState
public boolean getState()
- Returns the boolean state of the Checkbox.
- See Also:
- setState
setState
public void setState(boolean state)
- Sets the Checkbox to the specifed boolean state.
- Parameters:
- state - the boolean state
- See Also:
- getState
getCheckboxGroup
public CheckboxGroup getCheckboxGroup()
- Returns the checkbox group.
- See Also:
- setCheckboxGroup
setCheckboxGroup
public void setCheckboxGroup(CheckboxGroup g)
- Sets the CheckboxGroup to the specified group.
- Parameters:
- g - the new CheckboxGroup
- See Also:
- getCheckboxGroup
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