|
kAWT Version 0.98 | ||||||||
| 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(String s)
Construct a checkbox with the given label |
|
Checkbox(String label,
boolean checked)
Constructs a checkbox with the given label and state |
|
Checkbox(String s,
boolean state,
CheckboxGroup group)
Constructs a radio button with the given label and state belonging to the given checkbox group. |
|
Checkbox(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. |
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)
Processed 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(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.awt.Component |
addKeyListener,
addMouseListener,
addMouseMotionListener,
contains,
findComponentAt,
getBackground,
getBounds,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getLocationOnScreen,
getMaximumSize,
getMinimumSize,
getParent,
getPreferredSize,
getSize,
getWidth,
getX,
getY,
hasFocus,
invalidate,
isEnabled,
isFocusTraversable,
isValid,
isVisible,
paintAll,
processKeyEvent,
processMouseEvent,
repaint,
repaint,
requestFocus,
setBackground,
setBounds,
setEnabled,
setForeground,
setLocation,
setSize,
setSize,
setVisible,
update,
validate |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Checkbox()
public Checkbox(String s)
public Checkbox(String label,
boolean checked)
public Checkbox(String s,
boolean state,
CheckboxGroup group)
public Checkbox(String s,
CheckboxGroup group,
boolean state)
| Method Detail |
public void addItemListener(ItemListener il)
public Object[] getSelectedObjects()
public boolean getState()
public void paint(Graphics g)
public void processItemEvent(ItemEvent e)
public void removeItemListener(ItemListener l)
public void setCheckboxGroup(CheckboxGroup newGroup)
public void setState(boolean sel)
public void setLabel(String s)
|
kAWT Version 0.98 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||