APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.control

public final Class ButtonType

extends Object
Class Inheritance
Imports
com.sun.javafx.scene.control.skin.resources.ControlResources, javafx.beans.NamedArg, javafx.scene.control.ButtonBar.ButtonData

The ButtonType class is used as part of the JavaFX Dialog API (more specifically, the DialogPane API) to specify which buttons should be shown to users in the dialogs. Refer to the DialogPane class javadoc for more information on how to use this class.
Since
JavaFX 8u40
See Also
Alert, Dialog, DialogPane

Field Summary

Modifier and TypeField and Description
public static final ButtonType
APPLY

A pre-defined ButtonType that displays "Apply" and has a ButtonData of ButtonData#APPLY.

private final ButtonBar.ButtonData
public static final ButtonType
CANCEL

A pre-defined ButtonType that displays "Cancel" and has a ButtonData of ButtonData#CANCEL_CLOSE.

public static final ButtonType
CLOSE

A pre-defined ButtonType that displays "Close" and has a ButtonData of ButtonData#CANCEL_CLOSE.

public static final ButtonType
FINISH

A pre-defined ButtonType that displays "Finish" and has a ButtonData of ButtonData#FINISH.

private final String
public static final ButtonType
NEXT

A pre-defined ButtonType that displays "Next" and has a ButtonData of ButtonData#NEXT_FORWARD.

public static final ButtonType
NO

A pre-defined ButtonType that displays "No" and has a ButtonData of ButtonData#NO.

public static final ButtonType
OK

A pre-defined ButtonType that displays "OK" and has a ButtonData of ButtonData#OK_DONE.

public static final ButtonType
PREVIOUS

A pre-defined ButtonType that displays "Previous" and has a ButtonData of ButtonData#BACK_PREVIOUS.

private final String
public static final ButtonType
YES

A pre-defined ButtonType that displays "Yes" and has a ButtonData of ButtonData#YES.

Constructor Summary

AccessConstructor and Description
public
ButtonType(String
The string to display in the text property of controls such as Button.
text
)

Creates a ButtonType instance with the given text, and the ButtonData set as ButtonData#OTHER.

public
ButtonType(String
The string to display in the text property of controls such as Button.
text
,
ButtonBar.ButtonData
The type of button that should be created from this ButtonType.
buttonData
)

Creates a ButtonType instance with the given text, and the ButtonData set as specified.

private
ButtonType(String key, String text, ButtonBar.ButtonData buttonData)

Provide key or text.

Method Summary

Modifier and TypeMethod and Description
public final ButtonBar.ButtonData

Returns:

the ButtonData specified for this ButtonType in the constructor
getButtonData
()

Returns the ButtonData specified for this ButtonType in the constructor.

public final String

Returns:

the text specified for this ButtonType in the constructor
getText
()

Returns the text specified for this ButtonType in the constructor.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

APPLYback to summary
public static final ButtonType APPLY

A pre-defined ButtonType that displays "Apply" and has a ButtonData of ButtonData#APPLY.

buttonDataback to summary
private final ButtonBar.ButtonData buttonData
CANCELback to summary
public static final ButtonType CANCEL

A pre-defined ButtonType that displays "Cancel" and has a ButtonData of ButtonData#CANCEL_CLOSE.

CLOSEback to summary
public static final ButtonType CLOSE

A pre-defined ButtonType that displays "Close" and has a ButtonData of ButtonData#CANCEL_CLOSE.

FINISHback to summary
public static final ButtonType FINISH

A pre-defined ButtonType that displays "Finish" and has a ButtonData of ButtonData#FINISH.

keyback to summary
private final String key
NEXTback to summary
public static final ButtonType NEXT

A pre-defined ButtonType that displays "Next" and has a ButtonData of ButtonData#NEXT_FORWARD.

NOback to summary
public static final ButtonType NO

A pre-defined ButtonType that displays "No" and has a ButtonData of ButtonData#NO.

OKback to summary
public static final ButtonType OK

A pre-defined ButtonType that displays "OK" and has a ButtonData of ButtonData#OK_DONE.

PREVIOUSback to summary
public static final ButtonType PREVIOUS

A pre-defined ButtonType that displays "Previous" and has a ButtonData of ButtonData#BACK_PREVIOUS.

textback to summary
private final String text
YESback to summary
public static final ButtonType YES

A pre-defined ButtonType that displays "Yes" and has a ButtonData of ButtonData#YES.

Constructor Detail

ButtonTypeback to summary
public ButtonType(String text)

Creates a ButtonType instance with the given text, and the ButtonData set as ButtonData#OTHER.

Parameters
text:String

The string to display in the text property of controls such as Button.

ButtonTypeback to summary
public ButtonType(String text, ButtonBar.ButtonData buttonData)

Creates a ButtonType instance with the given text, and the ButtonData set as specified.

Parameters
text:String

The string to display in the text property of controls such as Button.

buttonData:ButtonBar.ButtonData

The type of button that should be created from this ButtonType.

ButtonTypeback to summary
private ButtonType(String key, String text, ButtonBar.ButtonData buttonData)

Provide key or text. The other one should be null.

Method Detail

getButtonDataback to summary
public final ButtonBar.ButtonData getButtonData()

Returns the ButtonData specified for this ButtonType in the constructor.

Returns:ButtonBar.ButtonData

the ButtonData specified for this ButtonType in the constructor

getTextback to summary
public final String getText()

Returns the text specified for this ButtonType in the constructor.

Returns:String

the text specified for this ButtonType in the constructor

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override