public class BRadioButton extends Widget
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:
Constructor and Description |
---|
BRadioButton(RadioButtonGroup group)
Create a new BRadioButton with no label, which is initially deselected.
|
BRadioButton(java.lang.String text,
boolean state,
RadioButtonGroup group)
Create a new BRadioButton.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JRadioButton |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
RadioButtonGroup |
getGroup()
Get the RadioButtonGroup this button is part of.
|
java.awt.Dimension |
getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn.
|
boolean |
getState()
Get the selection state of this radio button.
|
java.lang.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(java.lang.String text)
Set the text which appears on this radio button.
|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public BRadioButton(RadioButtonGroup group)
group
- the RadioButtonGroup this radio button is part ofpublic BRadioButton(java.lang.String text, boolean state, RadioButtonGroup group)
text
- the text to display on the BRadioButtonstate
- the initial selection state of the BRadioButtongroup
- the RadioButtonGroup this radio button is part ofpublic javax.swing.JRadioButton getComponent()
Widget
getComponent
in class Widget
public boolean getState()
public void setState(boolean selected)
public java.lang.String getText()
public void setText(java.lang.String text)
public RadioButtonGroup getGroup()
public void setGroup(RadioButtonGroup newGroup)
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class Widget
Written by Peter Eastman.