|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.ButtonGroup
uk.ac.starlink.util.gui.ValueButtonGroup
public class ValueButtonGroup
Extends ButtonGroup by associating a value with each button.
Field Summary |
---|
Fields inherited from class javax.swing.ButtonGroup |
---|
buttons |
Constructor Summary | |
---|---|
ValueButtonGroup()
Constructor. |
Method Summary | |
---|---|
void |
add(AbstractButton button,
Object value)
Adds a button and associates a value with it. |
void |
addChangeListener(ChangeListener listener)
Adds a listener which will be notified whenever this group's selected value changes. |
Object |
getValue()
Returns the currently selected value, that is the value associated with the currently selected button. |
void |
remove(AbstractButton button)
|
void |
removeChangeListener(ChangeListener listener)
Removes a listener previously added by addChangeListener . |
void |
setValue(Object value)
Sets the currently selected value. |
Methods inherited from class javax.swing.ButtonGroup |
---|
add, getButtonCount, getElements, getSelection, isSelected, setSelected |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueButtonGroup()
Method Detail |
---|
public void add(AbstractButton button, Object value)
button
is selected, getValue()
will
return value
. You can use null
for a
value, but don't have two buttons with associated values which
are equal.
button
- buttonvalue
- associated valuepublic void remove(AbstractButton button)
remove
in class ButtonGroup
public Object getValue()
public void setValue(Object value)
value
must be one
of the values associated with a button in this group.
value
- new valuepublic void addChangeListener(ChangeListener listener)
listener
- listener to addpublic void removeChangeListener(ChangeListener listener)
addChangeListener
.
listener
- listener to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |