public class ButtonList
extends java.lang.Object
buttons
where at most one button is active
at any time.Constructor and Description |
---|
ButtonList(Location location)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addButton(javax.swing.AbstractButton button)
Adds a button.
|
void |
addButtonListListener(ButtonListListener listener)
Adds a
ButtonListListener to be notified. |
int |
getButtonCount()
Returns the total number of buttons.
|
java.awt.Component |
getButtons()
Returns the
Container that contains all buttons. |
javax.swing.AbstractButton |
getSelectedButton()
Returns the currently selected button.
|
void |
removeButton(javax.swing.AbstractButton button)
Removes a button.
|
void |
selectButton(javax.swing.AbstractButton button)
Selects a button.
|
public ButtonList(@NotNull Location location)
location
- the locationpublic void addButtonListListener(@NotNull ButtonListListener listener)
ButtonListListener
to be notified.listener
- the button list listenerpublic void addButton(@NotNull javax.swing.AbstractButton button)
button
- the buttonpublic void removeButton(@NotNull javax.swing.AbstractButton button)
button
- the buttonpublic void selectButton(@NotNull javax.swing.AbstractButton button)
button
- the button@Nullable public javax.swing.AbstractButton getSelectedButton()
null
if no button exists@NotNull public java.awt.Component getButtons()
Container
that contains all buttons.public int getButtonCount()