public class RadioModel extends ToggleModel
A radio cannot be unchecked.
checked
Constructor and Description |
---|
RadioModel()
Creates an unchecked radio.
|
RadioModel(boolean checked)
Creates a radio with the given initial state.
|
Modifier and Type | Method and Description |
---|---|
void |
setChecked(boolean checked)
Sets the state of the toggle.
|
void |
toggle()
Changes the state of the toggle to the inverse of the current state.
|
addOnStateChangeListener, changeState, getGroup, isChecked, notifyOnStateChangeListener, removeOnStateChangeListener
public RadioModel()
public RadioModel(boolean checked)
checked
- if true
, the radio is initially checked; otherwise, the radio is initially unchecked.public void setChecked(boolean checked)
If the toggle is already in the given state, nothing change.
If the radio is checked, it cannot be unchecked.
setChecked
in class ToggleModel
checked
- the new state of the toggle.public void toggle()
If the radio is checked, it cannot be unchecked.
toggle
in class ToggleModel