|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.ButtonGroup | +--lava.gui.LButtonGroup
Extends ButtonGroup with miscellaneous features.
Details: LButtonGroup extends javax.swing.ButtonGroup to provide a few additional features.
ActionListeners can be attached to this group, so that they receive ActionEvents from all buttons in the group.
A selectNone method is provided to unselect the currently selected button, so that no buttons in the group appear selected. Select-none occurs either by means of a call, or automatically when the user clicks on the currently selected button. Select-none-ability is determined at construction time.
Fields inherited from class javax.swing.ButtonGroup |
buttons |
Constructor Summary | |
LButtonGroup(boolean none_is_legal)
Specifies whether select-none is allowed. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Broadcasts ActionEvents to ActionListeners. |
void |
add(javax.swing.AbstractButton b)
Adds a button to this group. |
void |
addActionListener(java.awt.event.ActionListener listener)
Registers an ActionListener with this LButtonGroup. |
java.util.Enumeration |
getElements()
Returns the buttons in this group. |
javax.swing.AbstractButton |
getSelectedButton()
Returns the currently selected button. |
javax.swing.ButtonModel |
getSelection()
Returns the currently selected button. |
void |
remove(javax.swing.AbstractButton b)
Removes a button from this group. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Unregisters an ActionListener with this LButtonGroup. |
void |
selectNone()
Deselects all buttons. |
Methods inherited from class javax.swing.ButtonGroup |
getButtonCount, isSelected, setSelected |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LButtonGroup(boolean none_is_legal)
Details: This constructor allows the caller to specify whether select-none is allowed.
none_is_legal
- select-none is allowedMethod Detail |
public void add(javax.swing.AbstractButton b)
add
in class javax.swing.ButtonGroup
b
- the buttonpublic void remove(javax.swing.AbstractButton b)
remove
in class javax.swing.ButtonGroup
b
- the buttonpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the ActionEvent to broadcastpublic void addActionListener(java.awt.event.ActionListener listener)
Details: addActionListener registers the given ActionListener to receive ActionEvents from buttons in this LButtonGroup.
ActionListeners that register with this LButtonGroup should unregister themselves when the listeners are no longer used. See removeActionListener
.
listener
- the ActionListener to registerpublic void removeActionListener(java.awt.event.ActionListener listener)
Details: removeActionListener removes the given ActionListener from the this LButtonGroup's list of registered listeners. The ActionListener will no longer receive ActionEvents through this LButtonGroup.
ActionListeners should unregister themselves when they are no longer in use.
listener
- the ActionListener to unregisterpublic void selectNone()
Details: selectNone deselects the currently selected button so that none of the buttons in the group is selected. This method has no effect if select-none is not allowed. (This feature is specified in the contructor.)
public java.util.Enumeration getElements()
Details: getElements in this class does the same thing as getElements in the superclass: it returns an Enumeration of all the buttons in this group.
getElements
in class javax.swing.ButtonGroup
public javax.swing.ButtonModel getSelection()
Details: getSelection in this class does the same thing as getElements in the superclass: it returns the ButtonModel of the currently selected button. If no button is selected, null is returned.
getSelection
in class javax.swing.ButtonGroup
public javax.swing.AbstractButton getSelectedButton()
Details: getSelectedButton returns the currently selected button. If no button is selected, null is returned.
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |