public class ButtonClickAction extends AbstractAction implements Runnable
JComponent.getActionMap()
or to click a button from a standalone thread.
As the button is internally stored as a weak reference it is up to the calling
object to keep a hard reference to the button to prevent the GC from reclaiming it.T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
ButtonClickAction(AbstractButton button)
Action constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
boolean |
isEnabled() |
void |
run() |
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
public ButtonClickAction(AbstractButton button)
button
- a button to click.public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public boolean isEnabled()
isEnabled
in interface Action
isEnabled
in class AbstractAction