Modifier and Type | Interface and Description |
---|---|
static interface |
Button.ButtonListener
This interface defines button listener that listens to both mouse pressed
and released events on the button.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
adds an action listener to the Button.
|
void |
addButtonListener(Button.ButtonListener listener)
add a button listener to the button.
|
void |
setSelected(boolean enabled)
sets the Button to selected/pressed state, or not.
|
void |
setText(java.lang.String text)
sets the text of the Button.
|
setEnabled, setVisible
void setText(java.lang.String text)
Sets the text that will be displayed on the button.
text
- the text for the Buttonvoid setSelected(boolean enabled)
enabled
- true if the button is pressed, false if notvoid addActionListener(ActionListener listener)
The action listener is invoked if the button is clicked and the mouse/finger is released inside the buttons frame.
listener
- the action listener to addvoid addButtonListener(Button.ButtonListener listener)
A button listener can listen to both button pressed and button released event.
listener
- the button listener to add