buoy.widget
Class BRadioButton
public class BRadioButton
A BRadioButton is a Widget for selecting between several options. It is normally used as part of a
RadioButtonGroup
. Each BRadioButton represents a single option. Clicking on it selects it, and
deselects all other members of its RadioButtonGroup.
In addition to the event types generated by all Widgets, BRadioButtons generate the following event types:
JRadioButton | getComponent()
|
RadioButtonGroup | getGroup() - Get the RadioButtonGroup this button is part of.
|
Dimension | getMaximumSize() - Get the largest size at which this Widget can reasonably be drawn.
|
boolean | getState() - Get the selection state of this radio button.
|
String | getText() - Get the text which appears on this radio button.
|
void | setGroup(RadioButtonGroup newGroup) - Set the RadioButtonGroup this button is part of.
|
void | setState(boolean selected) - Set the selection state of this radio button.
|
void | setText(String text) - Set the text which appears on this radio button.
|
addEventLink , dispatchEvent , getBackground , getBounds , getComponent , getCursor , getFont , getMaximumSize , getMinimumSize , getName , getParent , getPreferredSize , hasFocus , isEnabled , isFocusable , isVisible , repaint , requestFocus , setBackground , setCursor , setEnabled , setFocusable , setFont , setName , setVisible |
BRadioButton
public BRadioButton(String text,
boolean state,
RadioButtonGroup group)
Create a new BRadioButton.
text
- the text to display on the BRadioButtonstate
- the initial selection state of the BRadioButtongroup
- the RadioButtonGroup this radio button is part of
BRadioButton
public BRadioButton(RadioButtonGroup group)
Create a new BRadioButton with no label, which is initially deselected.
group
- the RadioButtonGroup this radio button is part of
getGroup
public RadioButtonGroup getGroup()
Get the RadioButtonGroup this button is part of.
getMaximumSize
public Dimension getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out
its contents, it will attempt never to make this Widget larger than its maximum size.
- getMaximumSize in interface Widget
getState
public boolean getState()
Get the selection state of this radio button.
getText
public String getText()
Get the text which appears on this radio button.
setGroup
public void setGroup(RadioButtonGroup newGroup)
Set the RadioButtonGroup this button is part of.
setState
public void setState(boolean selected)
Set the selection state of this radio button. If you set the selection state to true,
the state of every other member of its RadioButtonGroup will be set to false.
setText
public void setText(String text)
Set the text which appears on this radio button.
Written by Peter Eastman.