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