|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charvax.swing.ButtonGroup
This class is used to create a multiple-exclusion scope for a set of buttons. Adding a set of buttons to a ButtonGroup object means that turning any one of these buttons "on" turns off all other buttons in the group.
Initially, all buttons in the group are unselected. Once any button in the group is selected, one button is always selected in the group.
Note that the ButtonGroup is a logical grouping, not a physical grouping. To create a button panel, you should still create a JPanel and add the JRadioButtons to it.
Constructor Summary | |
ButtonGroup()
Creates a new ButtonGroup |
Method Summary | |
void |
add(AbstractButton button_)
Adds the specified button to the group. |
int |
getButtonCount()
Returns the number of buttons in the ButtonGroup. |
java.util.Enumeration |
getElements()
Returns an Enumeration of all the buttons in this group. |
AbstractButton |
getSelection()
Get the selected radiobutton. |
boolean |
isSelected(AbstractButton button_)
Returns the selected value for the specified button. |
void |
itemStateChanged(ItemEvent e_)
Implements the ItemListener interface. |
void |
remove(AbstractButton button_)
Remove the specified button from the group. |
void |
setSelected(AbstractButton button_,
boolean val_)
Sets the selected value for the specified button. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ButtonGroup()
Method Detail |
public void add(AbstractButton button_)
public int getButtonCount()
public java.util.Enumeration getElements()
public AbstractButton getSelection()
public boolean isSelected(AbstractButton button_)
public void remove(AbstractButton button_)
public void setSelected(AbstractButton button_, boolean val_)
public void itemStateChanged(ItemEvent e_)
itemStateChanged
in interface ItemListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |