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.


Constructor Index

 o Checkbox()
Constructs a Checkbox with an empty label.
 o Checkbox(String)
Constructs a Checkbox with the specified label.
 o Checkbox(String, boolean)
Constructs a Checkbox with the specified label.
 o Checkbox(String, boolean, CheckboxGroup)
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group.
 o Checkbox(String, CheckboxGroup, boolean)
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group.

Method Index

 o addItemListener(ItemListener)
Adds the specified item listener to recieve item events from this checkbox.
 o addNotify()
Creates the peer of the Checkbox.
 o getCheckboxGroup()
Returns the checkbox group.
 o getLabel()
Gets the label of the check box.
 o getSelectedObjects()
Returns the an array (length 1) containing the checkbox label or null if the checkbox is not selected.
 o getState()
Returns the boolean state of the Checkbox.
 o paramString()
Returns the parameter String of this Checkbox.
 o processEvent(AWTEvent)
Processes events on this checkbox.
 o processItemEvent(ItemEvent)
Processes item events occurring on this checkbox by dispatching them to any registered ItemListener objects.
 o removeItemListener(ItemListener)
Removes the specified item listener so that it no longer receives item events from this checkbox.
 o setCheckboxGroup(CheckboxGroup)
Sets the CheckboxGroup to the specified group.
 o setLabel(String)
Sets this check box's label to be the specified string.
 o setState(boolean)
Sets the Checkbox to the specifed boolean state.

Constructors

 o 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.

 o 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
 o 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
 o 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
 o 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.

Methods

 o 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
 o getLabel
    method getLabel() returns String public     
Gets the label of the check box.

See Also:
setLabel
 o 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
 o getState
    method getState() returns boolean public     
Returns the boolean state of the Checkbox.

See Also:
setState
 o setState
    method setState(state=boolean)  public     
Sets the Checkbox to the specifed boolean state.

Parameters:
state - the boolean state
See Also:
getState
 o 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
 o getCheckboxGroup
    method getCheckboxGroup() returns CheckboxGroup public     
Returns the checkbox group.

See Also:
setCheckboxGroup
 o setCheckboxGroup
    method setCheckboxGroup(g=CheckboxGroup)  public     
Sets the CheckboxGroup to the specified group.

Parameters:
g - the new CheckboxGroup
See Also:
getCheckboxGroup
 o addItemListener
    method addItemListener(l=ItemListener)  public     
Adds the specified item listener to recieve item events from this checkbox.

Parameters:
l - the item listener
 o 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
 o 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
 o 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
 o 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