
 |
Chapter 19 java.awt Reference |
 |
Checkbox
Name
Checkbox
The Checkbox is a Component
that provides a true or false toggle switch for user input.
- Description
-
Constructs a Checkbox object
with no label that is initially false.
- Parameters
-
- label
-
Text to display with the Checkbox.
- Description
-
Constructs a Checkbox object
with the given label that
is initially false.
- Parameters
-
- label
-
Text to display with the Checkbox.
- state
-
Intial value of the Checkbox.
- Description
-
Constructs a Checkbox with
the given label, initialized
to the given state.
- Parameters
-
- label
-
Text to display with the Checkbox.
- state
-
Intial value of the Checkbox.
- group
-
The CheckboxGroup this Checkbox should belong to.
- Description
-
Constructs a Checkbox with
the given label, initialized
to the given state and belonging
to group.
- Parameters
-
- label
-
Text to display with the Checkbox.
- group
-
The CheckboxGroup this Checkbox should belong to.
- state
-
Intial value of the Checkbox.
- Description
-
Constructs a Checkbox object
with the given settings.
- Parameters
-
- l
-
The listener to be added.
- Implements
-
ItemSelectable.addItemListener(ItemListener
l)
- Description
-
Adds a listener for the ItemEvent
objects this Checkbox generates.
- Overrides
-
Component.addNotify()
- Description
-
Creates Checkbox peer.
- Returns
-
The current CheckboxGroup associated
with the Checkbox, if any.
- Returns
-
The text associated with the Checkbox.
- Implements
-
ItemSelectable.getSelectedObjects()
- Description
-
If the Checkbox is checked,
returns an array with length 1 containing the label of the Checkbox;
otherwise returns null.
- Returns
-
The current state of the Checkbox.
- Parameters
-
- l
-
The listener to be removed.
- Implements
-
ItemSelectable.removeItemListener (ItemListener l)
- Description
-
Removes the specified ItemListener
so it will not receive ItemEvent
objects from this Checkbox.
- Parameters
-
- group
-
New group in which to place the Checkbox.
- Description
-
Associates the Checkbox with
a different CheckboxGroup.
- Parameters
-
- label
-
New text to associate with Checkbox.
- Description
-
Changes the text associated with the Checkbox.
- Parameters
-
- state
-
New state for the Checkbox.
- Description
-
Changes the state of the Checkbox.
- Returns
-
String with current settings of Checkbox.
- Overrides
-
Component.paramString()
- Description
-
Helper method for toString()
to generate string of current settings.
- Parameters
-
- e
-
The event to process.
- Description
-
Low level AWTEvents are passed
to this method for processing.
- Parameters
-
- e
-
The item event to process.
- Description
-
Item events are passed to this method for processing. Normally, this method
is called by processEvent().
CheckboxGroup, Component,
ItemEvent, ItemSelectable,
String
|
|