Button type (joe.win)


Extends: Control

The Button type is the base class for JavaFX labels like Button widgets.

Initializer

Methods

Control Methods

Region Methods

Node Methods

Properties

Button widgets have the following properties, in addition to those inherited from superclasses.

PropertyTypeDescription
#onActioncallable(1)The onAction handler
#textStringThe button's text
  • callable(1): A callable taking one argument

Button Initializer


Button([text], [action]) → Button

Returns a Button. If the text is given, the button will display the text. If the action is also given, it must be a no-arg callable; it will be invoked when the button is pressed.

Methods


button.action()


button.action(callable) → this

Adds a no-arg callable to the button as its action; pressing the button will invoke the callable.

button.text()


button.text(text) → this

Sets the button's text.