|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Checkbox
The Checkbox class can be used to display checkbox or radio button components. Checkboxes can be checked or unchecked. Radio buttons are created by assigning a group to checkboxes. Only one of the radio buttons of a group can be checked at a time, similar to the channel buttons of a radio. If a radio button is selected, the other radio buttons of the same group are unchecked automatically.
| Constructor Summary | |
Checkbox()
Constructs a checkbox without a label |
|
Checkbox(java.lang.String s)
Construct a checkbox with the given label |
|
Checkbox(java.lang.String label,
boolean checked)
Constructs a checkbox with the given label and state |
|
Checkbox(java.lang.String s,
boolean state,
CheckboxGroup group)
Constructs a radio button with the given label and state belonging to the given checkbox group. |
|
Checkbox(java.lang.String s,
CheckboxGroup group,
boolean state)
Constructs a radio button with the given label and state belonging to the given checkbox group. |
|
| Method Summary | |
void |
addItemListener(ItemListener il)
Adds an item listener to this checkbox. |
Dimension |
getMinimumSize()
|
java.lang.Object[] |
getSelectedObjects()
returns the an object array containing this checkbox if it is selected, otherwise an empty object array. |
boolean |
getState()
Returns the selection state of the checkbox. |
void |
paint(Graphics g)
Paints the checkbox to the given graphics context. |
void |
processItemEvent(ItemEvent e)
Processes the given item event by calling the registered listener. |
void |
removeItemListener(ItemListener l)
Removes the giveb item listener if it is registerd for this component |
void |
setCheckboxGroup(CheckboxGroup newGroup)
Assigns a checkbox group to this checkbox and turns it into a radio button. |
void |
setLabel(java.lang.String s)
Sets the label of the checkbox. |
void |
setState(boolean sel)
Sets the selection state of this checkbox and repaints it (deferred) if neccessary. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Checkbox()
public Checkbox(java.lang.String s)
public Checkbox(java.lang.String label,
boolean checked)
public Checkbox(java.lang.String s,
boolean state,
CheckboxGroup group)
public Checkbox(java.lang.String s,
CheckboxGroup group,
boolean state)
| Method Detail |
public void addItemListener(ItemListener il)
addItemListener in interface ItemSelectablepublic Dimension getMinimumSize()
getMinimumSize in class Componentpublic java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface ItemSelectablepublic boolean getState()
public void paint(Graphics g)
paint in class Componentpublic void processItemEvent(ItemEvent e)
public void removeItemListener(ItemListener l)
removeItemListener in interface ItemSelectablepublic void setCheckboxGroup(CheckboxGroup newGroup)
public void setState(boolean sel)
public void setLabel(java.lang.String s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||