Button
type (joe.win
)
Extends: Control
The Button
type is the base class for JavaFX
labels like Button
widgets.
- button.action(callable) → this
- button.text(text) → this
Control Methods
- control.tooltip(tooltip) → this
- control.tooltipText(text) → this
Region Methods
- region.height(height) → this
- region.padding(pixels) → this
- region.padding(top, right, bottom, left) → this
- region.prefHeight(height) → this
- region.prefWidth(width) → this
- region.width(width) → this
Node Methods
- node.disable([flag]) → this
- node.getProperty(keyword) → value
- node.gridColumn(index) → this
- node.gridColumnSpan(span) → this
- node.gridHalignment(hpos) → this
- node.gridHgrow([priority]) → this
- node.gridMargin(insets) → this
- node.gridRow(index) → this
- node.gridRowSpan(span) → this
- node.gridValignment(vpos) → this
- node.gridVgrow([priority]) → this
- node.hgrow([priority]) → this
- node.id(id) → this
- node.isDisabled() → joe.Boolean
- node.listenTo(keyword, listener) → this
- node.properties() → joe.Set
- node.setProperty(keyword, value) → this
- node.splitResizeWithParent(flag) → this
- node.styleClasses() → joe.List
- node.styles(style, ...) → this
- node.toString() → joe.String
- node.vgrow([priority]) → this
Properties
Button
widgets have the following properties, in addition to
those inherited from superclasses.
Property | Type | Description |
---|---|---|
#onAction | callable(1) | The onAction handler |
#text | String | The 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.