java.lang.Object | +--com.sun.kjava.CheckBox
A checkbox user interface object. A CheckBox object displays a check box next to a text label. It has two states, checked and unchecked.
Constructor Summary | |
CheckBox()
Create a new checkbox at an undefined position with no text label. |
|
CheckBox(int x,
int y,
java.lang.String text)
Create a new checkbox at a given position with a text label. |
Method Summary | |
void |
handlePenDown(int x,
int y)
The user selected the CheckBox; invert its state. |
void |
paint()
Paint the CheckBox. |
boolean |
pressed(int x,
int y)
Did the user's "press" fall within the CheckBox? |
void |
setLocation(int x,
int y)
Set the CheckBox's position. |
void |
setState(boolean state)
Set the state and redraw to reflect it. |
void |
setText(java.lang.String text)
Set the CheckBox's label. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public CheckBox()
public CheckBox(int x, int y, java.lang.String text)
x
- the X coordinate of position.y
- the Y coordinate of position.text
- label of the CheckBoxMethod Detail |
public void setLocation(int x, int y)
x
- the X coordinate of position.y
- the Y coordinate of position.public void setText(java.lang.String text)
public void paint()
public void handlePenDown(int x, int y)
public boolean pressed(int x, int y)
x
- the X coordinate of the user's pressy
- the Y coordinate of the user's press(x, y)
fall within boundspublic void setState(boolean state)
state
- the new state