|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.ButtonGroup | +--de.hunsicker.swing.EmptyButtonGroup
Extends the standard button group to allow empty groups. Again creating a set of buttons with the same EmptyButtonGroup object means that turning 'on' one of those buttons turns 'off' all other buttons in the group. The difference between EmptyButtonGroup and ButtonGroup lies in the fact that the currently selected button can be deselected which results - in an empty group.
Note that the original documentation for ButtonGroup (as of JDK 1.3) is wrong in that the initial state of the group does depend on the state of the added buttons (They claim 'Initially, all buttons in the group are unselected').
Field Summary | |
protected javax.swing.ButtonModel |
selection
The currently selected button. |
Fields inherited from class javax.swing.ButtonGroup |
buttons |
Constructor Summary | |
EmptyButtonGroup()
Creates a new EmptyButtonGroup object. |
Method Summary | |
void |
add(javax.swing.AbstractButton button)
Adds the given button to the group. |
javax.swing.ButtonModel |
getSelection()
Returns the selected button model. |
boolean |
isSelected(javax.swing.ButtonModel model)
Indicates whether the given button model is selected. |
void |
setSelected(javax.swing.ButtonModel model,
boolean select)
Sets the selected state of the given button model. |
Methods inherited from class javax.swing.ButtonGroup |
getButtonCount, getElements, remove |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.ButtonModel selection
null
if no button is selected.
Constructor Detail |
public EmptyButtonGroup()
Method Detail |
public void setSelected(javax.swing.ButtonModel model, boolean select)
setSelected
in class javax.swing.ButtonGroup
model
- model that has its state changed.select
- if true
selects the given model.public boolean isSelected(javax.swing.ButtonModel model)
isSelected
in class javax.swing.ButtonGroup
model
- model to check.
true
if the given model is selected.public javax.swing.ButtonModel getSelection()
getSelection
in class javax.swing.ButtonGroup
public void add(javax.swing.AbstractButton button)
add
in class javax.swing.ButtonGroup
button
- button to add.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |