javafx.ui

Button

Extends: Widget, RotatableWidget, ActionWidget

An implementation of a "push" button. Encapsulates javax.swing.JButton.

Attributes

public borderPainted: Boolean?
Sets whether (if this button has a border) the border is painted. Defaults to true.
private button: net.java.javafx.ui.XButton
public contentAreaFilled: Boolean?
Sets whether this button will paint the content area. If you wish to have a transparent button, such as an icon-only button, for example, then you should set this to false. Defaults to true.
public defaultButton: Boolean?
Determines whether this is the default button within a dialog.
public defaultCancelButton: Boolean?
Determines whether this is the default cancel button within a dialog.
public disabledIcon: Icon?
Sets this button's disabled icon.
public disabledSelectedIcon: Icon?
Sets this button's disabled selected icon.
public focusPainted: Boolean?
Sets whether the focus state is painted for this button. The default value for the focusPainted attribute is true. Some look and feels might not paint focus state; they will ignore this property.
public horizontalAlignment: HorizontalAlignment?
Sets the horizontal alignment of the the icon and text.

One of the following values:
  • CENTER
  • LEADING
  • TRAILING (the default)
public horizontalTextPosition: HorizontalAlignment?
Sets the horizontal position of the text relative to the icon.

One of the following values:
  • CENTER
  • LEADING
  • TRAILING (the default)
public icon: Icon?
Sets this button's default icon.
public iconTextGap: Number?
Sets the amount of space between the text and the icon displayed in this button.
public margin: Insets?
Sets space for margin between this button's border and the label. Setting to null will cause this button to use the default margin. The button's default Border object will use this value to create the proper margin. However, if a non-default border is set on the button, it is that Border object's responsibility to create the appropriate margin space (else this property will effectively be ignored).
public mnemonic: KeyStroke?
Sets this button's mnemonic.
public pressedIcon: Icon?
Sets this button's pressed icon.
public rolloverEnabled: Boolean
Sets whether rollover effects are enabled for this button. Defaults to true.
public rolloverIcon: Icon?
Sets this button's rollover icon.
public rolloverSelectedIcon: Icon?
Sets this button's selected rollover icon.
public selectedIcon: Icon?
Sets this button's selected icon.
public text: String?
Sets this button's text.
public verticalAlignment: VerticalAlignment?
Sets the vertical alignment of the icon and text.

One of the following values:
  • CENTER (the default)
  • TOP
  • BOTTOM
public verticalTextPosition: VerticalAlignment?
Sets the vertical position of the text relative to the icon.

One of the following values:
  • CENTER (the default)
  • TOP
  • BOTTOM

Attributes Inherited from javafx.ui.Widget

alignmentX, alignmentY, awtBackground, awtFont, awtForeground, background, border, component, componentOrientation, cursor, doubleBuffered, enabled, focusListener, focusTraversalKeysEnabled, focusable, focused, font, foreground, height, inBoundsListener, keyListener, keyboardAction, maximumSize, minimumSize, mouseListener, mouseMotionListener, mouseWheelListener, onKeyDown, onKeyTyped, onKeyUp, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelMoved, opaque, preferredSize, size, sizeToFitColumn, sizeToFitRow, toolTipText, visible, width, x, y

Attributes Inherited from javafx.ui.GroupElement

column, horizontal, row, vertical

Attributes Inherited from javafx.ui.UIElement

lookAndFeel

Attributes Inherited from javafx.ui.RotatableWidget

rotation

Attributes Inherited from javafx.ui.ActionWidget

action

Operations/Functions Inherited from javafx.ui.Widget

createComponent, function():function(java.awt.event.KeyEvent):function(java.awt.event.KeyEvent):function(java.awt.event.KeyEvent):function(java.awt.event.KeyEvent):javafx.ui.KeyEvent, getBounds, getComponent, getNonScrollPaneComponent, installMouseListener, installMouseMotionListener, installMouseWheelListener, makeKeyEvent, makeMouseEvent, makeMouseWheelEvent, maximumSize, minimumSize, onSetOpaque, preferredSize, requestFocus, setBounds, size

Operations/Functions Inherited from javafx.ui.UIElement

getWindow

Operations/Functions Inherited from javafx.ui.RotatableWidget

setRotation