AbstractButton

Extends
JComponent
Methods
31
Fields
1

Methods

MethodReturnsDescription
addActionListener(any)()Adds an ActionListener (a table with actionPerformed, or a function of the event): it runs when the button is clicked, the last added f…
removeActionListener(any)()Removes an ActionListener, by identity.
getActionListeners(){any}A copy of the ActionListeners, in registration order.
addChangeListener(any)()Adds a ChangeListener (the button's model changed), the last added first.
removeChangeListener(any)()Removes a ChangeListener, by identity.
getText()string?The text, or nil.
setText(string?)()Sets the text; a changed text lays the button out again.
isSelected()booleanWhether a toggle, check box or radio button is selected.
setSelected(boolean)()Selects or deselects it: when that changes, its ChangeListeners, then its ItemListeners, before this returns (they may not block on a d…
doClick()()Clicks it now: pressed, released and its action, as a click does (its listeners run before this returns).
getModel()ButtonModelThe model's state (isPressed, isRollover, ...) and its change listeners.
getActionCommand()string?The command its ActionEvents carry (the text, when none is set).
setActionCommand(string?)()Sets the command its ActionEvents carry.
getIcon()Icon?The icon, or nil.
setIcon(any)()Shows icon (an ImageIcon or the plugin's own Icon table); nil removes it.
setRolloverIcon(any)()The icon shown while the pointer is over it.
setSelectedIcon(any)()The icon shown while it is selected.
setRolloverSelectedIcon(any)()The icon shown while it is selected and the pointer is over it.
setPressedIcon(any)()The icon shown while it is pressed.
setDisabledIcon(any)()The icon shown while it is disabled; nil lets the look grey the icon.
setIconTextGap(number)()The gap between the icon and the text.
setHorizontalAlignment(number)()Aligns the icon and text horizontally (SwingConstants.LEFT, CENTER, RIGHT, LEADING, TRAILING).
setFocusPainted(boolean)()Whether the look paints the focus ring.
setBorderPainted(boolean)()Whether the look paints the border.
setContentAreaFilled(boolean)()Whether the look fills the background.
setRolloverEnabled(boolean)()Whether the pointer over it shows the rollover look and icon.
addItemListener(any)()Adds an ItemListener (selected or deselected), the last added first.
removeItemListener(any)()Removes an ItemListener, by identity.
setUI(any)()BasicButtonUI.new() or BasicToggleButtonUI.new() installs Swing's basic look on the button; any other delegate is kept and changes noth…
init(AbstractButton)()The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every nati…
isInstance(any)booleanWhether obj is a AbstractButton object, a class(AbstractButton) subclass's included.

Fields

FieldTypeDescription
superJComponentClassJComponent's class table: the base class.

Method details

addActionListener

addActionListener: (AbstractButton, any) -> ()

Adds an ActionListener (a table with actionPerformed, or a function of the event): it runs when the button is clicked, the last added first.

setSelected

setSelected: (AbstractButton, boolean) -> ()

Selects or deselects it: when that changes, its ChangeListeners, then its ItemListeners, before this returns (they may not block on a dialog).

doClick

doClick: (AbstractButton) -> ()

Clicks it now: pressed, released and its action, as a click does (its listeners run before this returns).

setIcon

setIcon: (AbstractButton, any) -> ()

Shows icon (an ImageIcon or the plugin's own Icon table); nil removes it.

setUI

setUI: (AbstractButton, any) -> ()

BasicButtonUI.new() or BasicToggleButtonUI.new() installs Swing's basic look on the button; any other delegate is kept and changes nothing.

init

init: (AbstractButton) -> ()

The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's super(); new does not take it.

isInstance

isInstance: (any) -> boolean

Whether obj is a AbstractButton object, a class(AbstractButton) subclass's included.