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
- implements ItemSelectable
A Checkbox object is a graphical user interface element that has a boolean
state.
-
Checkbox()
- Constructs a Checkbox with an empty label.
-
Checkbox(String)
- Constructs a Checkbox with the specified label.
-
Checkbox(String, boolean)
- Constructs a Checkbox with the specified label.
-
Checkbox(String, boolean, CheckboxGroup)
- Constructs a Checkbox with the specified label, set to the
specified state, and in the specified check box group.
-
Checkbox(String, CheckboxGroup, boolean)
- Constructs a Checkbox with the specified label, set to the
specified state, and in the specified check box group.
-
addItemListener(ItemListener)
- Adds the specified item listener to recieve item events from
this checkbox.
-
addNotify()
- Creates the peer of the Checkbox.
-
getCheckboxGroup()
- Returns the checkbox group.
-
getLabel()
- Gets the label of the check box.
-
getSelectedObjects()
- Returns the an array (length 1) containing the checkbox
label or null if the checkbox is not selected.
-
getState()
-
Returns the boolean state of the Checkbox.
-
paramString()
- Returns the parameter String of this Checkbox.
-
processEvent(AWTEvent)
- Processes events on this checkbox.
-
processItemEvent(ItemEvent)
-
Processes item events occurring on this checkbox by
dispatching them to any registered ItemListener objects.
-
removeItemListener(ItemListener)
- Removes the specified item listener so that it no longer
receives item events from this checkbox.
-
setCheckboxGroup(CheckboxGroup)
- Sets the CheckboxGroup to the specified group.
-
setLabel(String)
- Sets this check box's label to be the specified string.
-
setState(boolean)
-
Sets the Checkbox to the specifed boolean state.
Checkbox
method Checkbox() public
- Constructs a Checkbox with an empty label. The check box starts in a
false state and is not part of any check box group.
Checkbox
method Checkbox(label=String) public
- Constructs a Checkbox with the specified label. The check box
starts in a false state and is not part of any check box group.
- Parameters:
- label - the label on the Checkbox
Checkbox
method Checkbox(label=String, -
state=boolean) public
- Constructs a Checkbox with the specified label. The check box
starts in the specified state and is not part of any check box
group.
- Parameters:
- label - the label on the Checkbox
- state - is the initial state of this Checkbox
- group - the CheckboxGroup this Checkbox is in
Checkbox
method Checkbox(label=String, -
state=boolean, -
group=CheckboxGroup) public
- Constructs a Checkbox with the specified label, set to the
specified state, and in the specified check box group.
- Parameters:
- label - the label on the Checkbox
- state - is the initial state of this Checkbox
- group - the CheckboxGroup this Checkbox is in
Checkbox
method Checkbox(label=String, -
group=CheckboxGroup, -
state=boolean) public
- Constructs a Checkbox with the specified label, set to the
specified state, and in the specified check box group.
addNotify
method addNotify() public
- 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
method getLabel() returns String public
- Gets the label of the check box.
- See Also:
- setLabel
setLabel
method setLabel(label=String) public protect
- Sets this check box's label to be the specified string.
- Parameters:
- label - the label of the button
- See Also:
- getLabel
getState
method getState() returns boolean public
- Returns the boolean state of the Checkbox.
- See Also:
- setState
setState
method setState(state=boolean) public
- Sets the Checkbox to the specifed boolean state.
- Parameters:
- state - the boolean state
- See Also:
- getState
getSelectedObjects
method getSelectedObjects() returns Object[] public
- Returns the an array (length 1) containing the checkbox
label or null if the checkbox is not selected.
- See Also:
- ItemSelectable
getCheckboxGroup
method getCheckboxGroup() returns CheckboxGroup public
- Returns the checkbox group.
- See Also:
- setCheckboxGroup
setCheckboxGroup
method setCheckboxGroup(g=CheckboxGroup) public
- Sets the CheckboxGroup to the specified group.
- Parameters:
- g - the new CheckboxGroup
- See Also:
- getCheckboxGroup
addItemListener
method addItemListener(l=ItemListener) public
- Adds the specified item listener to recieve item events from
this checkbox.
- Parameters:
- l - the item listener
removeItemListener
method removeItemListener(l=ItemListener) public
- Removes the specified item listener so that it no longer
receives item events from this checkbox.
- Parameters:
- l - the item listener
processEvent
method processEvent(e=AWTEvent) Inheritable
- Processes events on this checkbox. If the event is an ItemEvent,
it invokes the handleItemEvent method, else it calls its
superclass's processEvent.
- Parameters:
- e - the event
- Overrides:
- processEvent in class Component
processItemEvent
method processItemEvent(e=ItemEvent) Inheritable
- Processes item events occurring on this checkbox by
dispatching them to any registered ItemListener objects.
NOTE: This method will not be called unless item events
are enabled for this component; this happens when one of the
following occurs:
a) An ItemListener object is registered via addItemListener()
b) Item events are enabled via enableEvents()
- Parameters:
- e - the item event
- See Also:
- enableEvents
paramString
method paramString() returns String Inheritable
- Returns the parameter String of this Checkbox.
- Overrides:
- paramString in class Component
All Packages Class Hierarchy This Package Previous Next Index