java.lang.Object | +--com.sun.kjava.RadioButton
A two-state button meant as part of a group, only one of which can be "on" at one time.
RadioGroup
Constructor Summary | |
RadioButton()
Create a new RadioButton. |
|
RadioButton(int x,
int y,
java.lang.String text)
Create a new RadioButton. |
Method Summary | |
java.lang.String |
getText()
Get the label of the button. |
void |
handlePenDown(int x,
int y)
The pen has gone down in the button. |
boolean |
isSelected()
Is this RadioButton currently selected? |
void |
paint()
Paint the RadioButton on the screen. |
boolean |
pressed(int x,
int y)
Did the user press inside the RadioButton? |
void |
setLocation(int x,
int y)
Set the position of the RadioButton. |
void |
setParent(RadioGroup rg)
Set the parent RadioGroup of this button. |
void |
setState(boolean state)
Set the state of the button. |
void |
setText(java.lang.String text)
Set the label of the button. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public RadioButton()
public RadioButton(int x, int y, java.lang.String text)
x
- the X coordinate of the RadioButton's positiony
- the Y coordinate of the RadioButton's positiontext
- the label for the buttonMethod Detail |
public void setLocation(int x, int y)
x
- the X coordinate of the RadioButton's positiony
- the Y coordinate of the RadioButton's positionpublic void setText(java.lang.String text)
text
- the new text of the labelpublic java.lang.String getText()
public void paint()
public void handlePenDown(int x, int y)
x
- the X coordinate of the RadioButton's positiony
- the Y coordinate of the RadioButton's positionpublic boolean pressed(int x, int y)
x
- the X coordinate of the RadioButton's positiony
- the Y coordinate of the RadioButton's positionpublic void setParent(RadioGroup rg)
rg
- the parental RadioGrouppublic void setState(boolean state)
state
- the new state; true
means "selected"public boolean isSelected()