Overview

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

Attribute Summary

nametypedescription
Public
borderPaintedBoolean

Sets whether (if this button has a border) the border is painted.

contentAreaFilledBoolean

Sets whether this button will paint the content area.

defaultButtonBoolean

Determines whether this is the default button within a dialog.

defaultCancelButtonBoolean

Determines whether this is the default cancel button within a dialog.

disabledIconIcon

Sets this button's disabled icon.

disabledSelectedIconIcon

Sets this button's disabled selected icon.

focusPaintedBoolean

Sets whether the focus state is painted for this button.

horizontalAlignmentHorizontalAlignment

Sets the horizontal alignment of the the icon and text.

One of the following values:

  • CENTER
  • LEADING
  • TRAILING (the default)

horizontalTextPositionHorizontalAlignment

Sets the horizontal position of the text relative to the icon.

One of the following values:

  • CENTER
  • LEADING
  • TRAILING (the default)

iconIcon

Sets this button's default icon.

iconTextGapNumber

Sets the amount of space between the text and the icon displayed in this button.

marginInsets

Sets space for margin between this button's border and the label.

mnemonicKeyStroke

Sets this button's mnemonic.

pressedIconIcon

Sets this button's pressed icon.

rolloverEnabledBoolean

Sets whether rollover effects are enabled for this button.

rolloverIconIcon

Sets this button's rollover icon.

rolloverSelectedIconIcon

Sets this button's selected rollover icon.

selectedIconIcon

Sets this button's selected icon.

textString

Sets this button's text.

verticalAlignmentVerticalAlignment

Sets the vertical alignment of the icon and text.

One of the following values:

  • CENTER (the default)
  • TOP
  • BOTTOM

verticalTextPositionVerticalAlignment

Sets the vertical position of the text relative to the icon.

One of the following values:

  • CENTER (the default)
  • TOP
  • BOTTOM

Protected

Inherited Attributes

javafx.ui.Widget

publicnametype
alignmentXNumber

Returns the alignment along the x axis.

alignmentYNumber

Returns the alignment along the y axis.

awtBackgroundColor
awtFontFont
awtForegroundColor
backgroundColor

Sets the background color of this component.

borderBorder

Sets the border of this component.

componentJComponent
componentOrientationComponentOrientation

Sets the language-sensitive orientation that is to be used to order the elements or text within this component.

cursorCursor

Sets the cursor image to the specified cursor.

doubleBufferedBoolean

Sets whether the this component should use a buffer to paint.

enabledBoolean

True when the object is enabled.

focusableBoolean

Sets the focusable state of this Widget to the specified value.

focusedBoolean
focusTraversalKeysEnabledBoolean
fontFont

Sets the Font of this object.

foregroundColor

Sets the foreground color of this component.

heightNumber

Sets the height of this component.

keyboardActionKeyboardAction[]
keyListenerKeyListener
maximumSizeDimension

Sets the maximum size of this component to a constant value.

minimumSizeDimension

Sets the minimum size of this component to a constant value.

mouseListenerMouseListener
mouseMotionListenerMouseMotionListener
mouseWheelListenerMouseWheelListener
nameString
onKeyDownfunction(:KeyEvent):Void

attribute onKeyDown: function(:KeyEvent):Void; Optional handler for key press events.

onKeyTypedfunction(:KeyEvent):Void

attribute onKeyTyped: function(:KeyEvent):Void Optional handler for key typed events.

onKeyUpfunction(:KeyEvent):Void

attribute onKeyUp: function(:KeyEvent):Void; Optional handler for key release events.

onMouseClickedfunction(:MouseEvent):Void

attribute onMouseClicked: function(:MouseEvent):Void

Optional handler for mouse exit events.

onMouseDraggedfunction(:MouseEvent):Void

attribute onMouseDragged: function(:MouseEvent):Void

Optional handler for mouse dragged events.

onMouseEnteredfunction(:MouseEvent):Void

attribute onMouseEntered: function(:MouseEvent):Void

Optional handler for mouse enter events.

onMouseExitedfunction(:MouseEvent):Void

attribute onMouseExited: function(:MouseEvent):Void

Optional handler for mouse exit events.

onMouseMovedfunction(:MouseEvent):Void

attribute onMouseMoved: function(:MouseEvent):Void

Optional handler for mouse motion events.

onMousePressedfunction(:MouseEvent):Void

attribute onMousePressed: function(:MouseEvent):Void

Optional handler for mouse press events.

onMouseReleasedfunction(:MouseEvent):Void

attribute onMouseReleased: function(:MouseEvent):Void

Optional handler for mouse release events.

onMouseWheelMovedfunction(:MouseWheelEvent):Void

attribute onMouseWheelMoved: function(:MouseWheelEvent):Void

Optional handler for mouse wheel events.

opaqueBoolean

If true the component paints every pixel within its bounds.

preferredSizeDimension
sizeDimension

Resizes this component to the specified dimensions.

sizeToFitColumnBoolean

Hint to GroupLayout to make this component's width equal to others in the same column

sizeToFitRowBoolean

Hint to GroupLayout to make this component's height equal to others in the same row

toolTipTextString

Registers the text to display in a tool tip.

visibleBoolean

True when the object is visible.

widthNumber

Sets width of this component.

xNumber

Sets the x coordinate of this component within its parent.

yNumber

Sets the y coordinate of this component within its parent.

javafx.ui.GroupElement

publicnametype
columnColumn

The column this element is contained in within a GroupLayout.

horizontalSpring

Optional horizontal spring that determines the horizontal resizing behavior of this element when contained in a GroupLayout.

rowRow

The row this element is contained in within a GroupLayout.

verticalSpring

Optional vertical spring that determines the vertical resizing behavior of this element when contained in a GroupLayout.

javafx.ui.UIElement

publicnametype
contextUIContext
lookAndFeelString

javafx.ui.ActionWidget

publicnametype
actionfunction():Void

Function which implements this widget's action.

javafx.ui.Widget

publicnametype
alignmentXNumber

Returns the alignment along the x axis.

alignmentYNumber

Returns the alignment along the y axis.

awtBackgroundColor
awtFontFont
awtForegroundColor
backgroundColor

Sets the background color of this component.

borderBorder

Sets the border of this component.

componentJComponent
componentOrientationComponentOrientation

Sets the language-sensitive orientation that is to be used to order the elements or text within this component.

cursorCursor

Sets the cursor image to the specified cursor.

doubleBufferedBoolean

Sets whether the this component should use a buffer to paint.

enabledBoolean

True when the object is enabled.

focusableBoolean

Sets the focusable state of this Widget to the specified value.

focusedBoolean
focusTraversalKeysEnabledBoolean
fontFont

Sets the Font of this object.

foregroundColor

Sets the foreground color of this component.

heightNumber

Sets the height of this component.

keyboardActionKeyboardAction[]
keyListenerKeyListener
maximumSizeDimension

Sets the maximum size of this component to a constant value.

minimumSizeDimension

Sets the minimum size of this component to a constant value.

mouseListenerMouseListener
mouseMotionListenerMouseMotionListener
mouseWheelListenerMouseWheelListener
nameString
onKeyDownfunction(:KeyEvent):Void

attribute onKeyDown: function(:KeyEvent):Void; Optional handler for key press events.

onKeyTypedfunction(:KeyEvent):Void

attribute onKeyTyped: function(:KeyEvent):Void Optional handler for key typed events.

onKeyUpfunction(:KeyEvent):Void

attribute onKeyUp: function(:KeyEvent):Void; Optional handler for key release events.

onMouseClickedfunction(:MouseEvent):Void

attribute onMouseClicked: function(:MouseEvent):Void

Optional handler for mouse exit events.

onMouseDraggedfunction(:MouseEvent):Void

attribute onMouseDragged: function(:MouseEvent):Void

Optional handler for mouse dragged events.

onMouseEnteredfunction(:MouseEvent):Void

attribute onMouseEntered: function(:MouseEvent):Void

Optional handler for mouse enter events.

onMouseExitedfunction(:MouseEvent):Void

attribute onMouseExited: function(:MouseEvent):Void

Optional handler for mouse exit events.

onMouseMovedfunction(:MouseEvent):Void

attribute onMouseMoved: function(:MouseEvent):Void

Optional handler for mouse motion events.

onMousePressedfunction(:MouseEvent):Void

attribute onMousePressed: function(:MouseEvent):Void

Optional handler for mouse press events.

onMouseReleasedfunction(:MouseEvent):Void

attribute onMouseReleased: function(:MouseEvent):Void

Optional handler for mouse release events.

onMouseWheelMovedfunction(:MouseWheelEvent):Void

attribute onMouseWheelMoved: function(:MouseWheelEvent):Void

Optional handler for mouse wheel events.

opaqueBoolean

If true the component paints every pixel within its bounds.

preferredSizeDimension
sizeDimension

Resizes this component to the specified dimensions.

sizeToFitColumnBoolean

Hint to GroupLayout to make this component's width equal to others in the same column

sizeToFitRowBoolean

Hint to GroupLayout to make this component's height equal to others in the same row

toolTipTextString

Registers the text to display in a tool tip.

visibleBoolean

True when the object is visible.

widthNumber

Sets width of this component.

xNumber

Sets the x coordinate of this component within its parent.

yNumber

Sets the y coordinate of this component within its parent.

javafx.ui.GroupElement

publicnametype
columnColumn

The column this element is contained in within a GroupLayout.

horizontalSpring

Optional horizontal spring that determines the horizontal resizing behavior of this element when contained in a GroupLayout.

rowRow

The row this element is contained in within a GroupLayout.

verticalSpring

Optional vertical spring that determines the vertical resizing behavior of this element when contained in a GroupLayout.

javafx.ui.UIElement

publicnametype
contextUIContext
lookAndFeelString

Function Summary

public createComponent() : JComponent

Inherited Functions

javafx.ui.Widget

protected abstract createComponent() : JComponent

factory method to create the underlying Swing component

public getComponent() : JComponent
public getJComponent() : JComponent
public getMaximumSize() : Dimension

Returns the current maximum size of this component

public getMinimumSize() : Dimension

Returns the current minimum size of this component

public getNonScrollPaneComponent() : JComponent
public getPreferredSize() : Dimension

Returns the current preferred size of this component

public getSize() : Dimension
public bound getWindow() : Window
protected installMouseListener() : Void
protected installMouseMotionListener() : Void
protected installMouseWheelListener() : Void
protected onSetOpaque(value: Boolean, ) : Void
public requestFocus() : Void

javafx.ui.UIElement

public static __EASE(a: Object, t: Number, f: Function1, interpolate: Function3, ) : Object
public static __EASEBOTH(t: Number, ) : Number
public static __EASEIN(t: Number, ) : Number
public static __EASEOUT(t: Number, ) : Number
public static __INTERPOLATE_NUM(value1: Number, value2: Number, t: Number, ) : Number
public static cmToPixel(cm: Number, ) : Number
public static DISCRETE(a: Number, t: Number, ) : Number
public static EASEBOTH(a: Number, t: Number, ) : Number
public static EASEIN(a: Number, t: Number, ) : Number
public static EASEOUT(a: Number, t: Number, ) : Number
public static getScreenResolution() : Integer
public static getUIContext() : UIContext
public bound getWindow() : Window
public static inchToPixel(inch: Number, ) : Number
public static LINEAR(a: Number, t: Number, ) : Number
public static mmToPixel(mm: Number, ) : Number
public static pointToPixel(pt: Integer, ) : Number

javafx.ui.Widget

protected abstract createComponent() : JComponent

factory method to create the underlying Swing component

public getComponent() : JComponent
public getJComponent() : JComponent
public getMaximumSize() : Dimension

Returns the current maximum size of this component

public getMinimumSize() : Dimension

Returns the current minimum size of this component

public getNonScrollPaneComponent() : JComponent
public getPreferredSize() : Dimension

Returns the current preferred size of this component

public getSize() : Dimension
public bound getWindow() : Window
protected installMouseListener() : Void
protected installMouseMotionListener() : Void
protected installMouseWheelListener() : Void
protected onSetOpaque(value: Boolean, ) : Void
public requestFocus() : Void

javafx.ui.UIElement

public static __EASE(a: Object, t: Number, f: Function1, interpolate: Function3, ) : Object
public static __EASEBOTH(t: Number, ) : Number
public static __EASEIN(t: Number, ) : Number
public static __EASEOUT(t: Number, ) : Number
public static __INTERPOLATE_NUM(value1: Number, value2: Number, t: Number, ) : Number
public static cmToPixel(cm: Number, ) : Number
public static DISCRETE(a: Number, t: Number, ) : Number
public static EASEBOTH(a: Number, t: Number, ) : Number
public static EASEIN(a: Number, t: Number, ) : Number
public static EASEOUT(a: Number, t: Number, ) : Number
public static getScreenResolution() : Integer
public static getUIContext() : UIContext
public bound getWindow() : Window
public static inchToPixel(inch: Number, ) : Number
public static LINEAR(a: Number, t: Number, ) : Number
public static mmToPixel(mm: Number, ) : Number
public static pointToPixel(pt: Integer, ) : Number

Attributes

public borderPainted: Boolean

Sets whether (if this button has a border) the border is painted. Defaults to true.

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

Functions