- java.lang.Object
- 
- javafx.scene.control.Dialog<R>
 
- 
- Type Parameters:
- R- The return type of the dialog, via the- resultproperty.
 - All Implemented Interfaces:
- EventTarget
 - Direct Known Subclasses:
- Alert,- ChoiceDialog,- TextInputDialog
 
 public class Dialog<R> extends Object implements EventTarget A Dialog in JavaFX wraps aDialogPaneand provides the necessary API to present it to end users. In JavaFX 8u40, this essentially means that theDialogPaneis shown to users inside aStage, but future releases may offer alternative options (such as 'lightweight' or 'internal' dialogs). This API therefore is intentionally ignorant of the underlying implementation, and attempts to present a common API for all possible implementations.The Dialog class has a single generic type, R, which is used to represent the type of the resultproperty (and also, how to convert fromButtonTypeto R, through the use of theresult converterCallback).Critical note: It is critical that all developers who choose to create their own dialogs by extending the Dialog class understand the importance of the result converterproperty. A result converter must always be set, whenever the R type is notVoidorButtonType. If this is not heeded, developers will find that they get ClassCastExceptions in their code, for failure to convert fromButtonTypevia theresult converter.It is likely that most developers would be better served using either the Alertclass (for pre-defined, notification-style alerts), or either of the two pre-built dialogs (TextInputDialogandChoiceDialog), depending on their needs.Once a Dialog is instantiated, the next step is to configure it. Almost all properties on Dialog are not related to the content of the Dialog, the only exceptions are contentTextProperty(),headerTextProperty(), andgraphicProperty(), and these properties are simply forwarding API onto the respective properties on theDialogPanestored in thedialog paneproperty. These three properties are forwarded from DialogPane for developer convenience. For developers wanting to configure their dialog, they will in many cases be required to use code along the lines ofdialog.getDialogPane().setExpandableContent(node).After configuring these properties, all that remains is to consider whether the buttons (created using ButtonTypeand theDialogPane.createButton(ButtonType)method) are fully configured. Developers will quickly find that the amount of configurability offered via theButtonTypeclass is minimal. This is intentional, but does not mean that developers can not modify the buttons created by theButtonTypethat have been specified. To do this, developers simply call theDialogPane.lookupButton(ButtonType)method with the ButtonType (assuming it has already been set in theDialogPane.getButtonTypes()list. The returned Node is typically of typeButton, but this depends on if theDialogPane.createButton(ButtonType)method has been overridden. A typical approach is therefore along the following lines:ButtonType loginButtonType = new ButtonType("Login", ButtonData.OK_DONE); Dialog<String> dialog = new Dialog<>(); dialog.setTitle("Login Dialog"); dialog.setContentText("Would you like to log in?"); dialog.getDialogPane().getButtonTypes().add(loginButtonType); boolean disabled = false; // computed based on content of text fields, for example dialog.getDialogPane().lookupButton(loginButtonType).setDisable(disabled); dialog.showAndWait();  Once a Dialog is instantiated and fully configured, the next step is to show it. More often than not, dialogs are shown in a modal and blocking fashion. 'Modal' means that the dialog prevents user interaction with the owning application whilst it is showing, and 'blocking' means that code execution stops at the point in which the dialog is shown. This means that you can show a dialog, await the user response, and then continue running the code that directly follows the show call, giving developers the ability to immediately deal with the user input from the dialog (if relevant). JavaFX dialogs are modal by default (you can change this via the initModality(javafx.stage.Modality)API). To specify whether you want blocking or non-blocking dialogs, developers simply choose to callshowAndWait()orshow()(respectively). By default most developers should choose to useshowAndWait(), given the ease of coding in these situations. Shown below is three code snippets, showing three equally valid ways of showing a dialog:Option 1: The 'traditional' approach Optional<ButtonType> result = dialog.showAndWait(); if (result.isPresent() && result.get() == ButtonType.OK) { formatSystem(); }Option 2: The traditional + Optional approach dialog.showAndWait().ifPresent(response -> { if (response == ButtonType.OK) { formatSystem(); } });Option 3: The fully lambda approach dialog.showAndWait() .filter(response -> response == ButtonType.OK) .ifPresent(response -> formatSystem());There is no better or worse option of the three listed above, so developers are encouraged to work to their own style preferences. The purpose of showing the above is to help introduce developers to the OptionalAPI, which is new in Java 8 and may be foreign to many developers.Dialog Validation / Intercepting Button ActionsIn some circumstances it is desirable to prevent a dialog from closing until some aspect of the dialog becomes internally consistent (e.g. a form inside the dialog has all fields in a valid state). To do this, users of the dialogs API should become familiar with the DialogPane.lookupButton(ButtonType)method. By passing in aButtonType(that has already been set in thebutton typeslist), users will be returned a Node that is typically of typeButton(but this depends on if theDialogPane.createButton(ButtonType)method has been overridden). With this button, users may add an event filter that is called before the button does its usual event handling, and as such users may prevent the event handling byconsumingthe event. Here's a simplified example:final Button btOk = (Button) dlg.getDialogPane().lookupButton(ButtonType.OK); btOk.addEventFilter(ActionEvent.ACTION, event -> { if (!validateAndStore()) { event.consume(); } });Dialog Closing RulesIt is important to understand what happens when a Dialog is closed, and also how a Dialog can be closed, especially in abnormal closing situations (such as when the 'X' button is clicked in a dialogs title bar, or when operating system specific keyboard shortcuts (such as alt-F4 on Windows) are entered). Fortunately, the outcome is well-defined in these situations, and can be best summarised in the following bullet points: - JavaFX dialogs can only be closed 'abnormally' (as defined above) in
   two situations:
     - When the dialog only has one button, or
- When the dialog has multiple buttons, as long as one of them meets
       one of the following requirements:
       - The button has a ButtonTypewhoseButtonBar.ButtonDatais of typeButtonBar.ButtonData.CANCEL_CLOSE.
- The button has a ButtonTypewhoseButtonBar.ButtonDatareturns true whenButtonBar.ButtonData.isCancelButton()is called.
 
- The button has a 
 
- In all other situations, the dialog will refuse to respond to all
   close requests, remaining open until the user clicks on one of the available
   buttons in the DialogPanearea of the dialog.
- If a dialog is closed abnormally, and if the dialog contains a button
   which meets one of the two criteria above, the dialog will attempt to set
   the resultproperty to whatever value is returned from calling theresult converterwith the first matchingButtonType.
- If for any reason the result converter returns null, or if the dialog
   is closed when only one non-cancel button is present, the
   resultproperty will be null, and theshowAndWait()method will returnOptional.empty(). This later point means that, if you use either of option 2 or option 3 (as presented earlier in this class documentation), theOptional.ifPresent(java.util.function.Consumer)lambda will never be called, and code will continue executing as if the dialog had not returned any value at all.
 - Since:
- JavaFX 8u40
- See Also:
- Alert,- TextInputDialog,- ChoiceDialog
 
- 
- 
Property SummaryProperties Type Property Description StringPropertycontentTextA property representing the content text for the dialog pane.ObjectProperty<DialogPane>dialogPaneThe root node of the dialog, theDialogPanecontains all visual elements shown in the dialog.ObjectProperty<Node>graphicThe dialog graphic, presented either in the header, if one is showing, or to the left of thecontent.StringPropertyheaderTextA property representing the header text for the dialog pane.ReadOnlyDoublePropertyheightProperty representing the height of the dialog.ObjectProperty<EventHandler<DialogEvent>>onCloseRequestCalled when there is an external request to close thisDialog.ObjectProperty<EventHandler<DialogEvent>>onHiddenCalled just after the Dialog has been hidden.ObjectProperty<EventHandler<DialogEvent>>onHidingCalled just prior to the Dialog being hidden.ObjectProperty<EventHandler<DialogEvent>>onShowingCalled just prior to the Dialog being shown.ObjectProperty<EventHandler<DialogEvent>>onShownCalled just after the Dialog is shown.BooleanPropertyresizableRepresents whether the dialog is resizable.ObjectProperty<Callback<ButtonType,R>>resultConverterAPI to convert theButtonTypethat the user clicked on into a result that can be returned via theresultproperty.ObjectProperty<R>resultA property representing what has been returned from the dialog.ReadOnlyBooleanPropertyshowingRepresents whether the dialog is currently showing.StringPropertytitleReturn the titleProperty of the dialog.ReadOnlyDoublePropertywidthProperty representing the width of the dialog.ReadOnlyDoublePropertyxThe horizontal location of thisDialog.ReadOnlyDoublePropertyyThe vertical location of thisDialog.
 - 
Constructor SummaryConstructors Constructor Description Dialog()Creates a dialog without a specified owner.
 - 
Method SummaryModifier and Type Method Description EventDispatchChainbuildEventDispatchChain(EventDispatchChain tail)Construct an event dispatch chain for this target.voidclose()Closes thisDialog.StringPropertycontentTextProperty()A property representing the content text for the dialog pane.ObjectProperty<DialogPane>dialogPaneProperty()The root node of the dialog, theDialogPanecontains all visual elements shown in the dialog.StringgetContentText()Returns the currently-set content text for this DialogPane.DialogPanegetDialogPane()Gets the value of the property dialogPane.NodegetGraphic()Gets the value of the property graphic.StringgetHeaderText()Returns the currently-set header text for this DialogPane.doublegetHeight()Returns the height of the dialog.ModalitygetModality()Retrieves the modality attribute for this dialog.EventHandler<DialogEvent>getOnCloseRequest()Gets the value of the property onCloseRequest.EventHandler<DialogEvent>getOnHidden()Gets the value of the property onHidden.EventHandler<DialogEvent>getOnHiding()Gets the value of the property onHiding.EventHandler<DialogEvent>getOnShowing()Gets the value of the property onShowing.EventHandler<DialogEvent>getOnShown()Gets the value of the property onShown.WindowgetOwner()Retrieves the owner Window for this dialog, or null for an unowned dialog.RgetResult()Gets the value of the property result.Callback<ButtonType,R>getResultConverter()Gets the value of the property resultConverter.StringgetTitle()Return the title of the dialog.doublegetWidth()Returns the width of the dialog.doublegetX()Gets the value of the property x.doublegetY()Gets the value of the property y.ObjectProperty<Node>graphicProperty()The dialog graphic, presented either in the header, if one is showing, or to the left of thecontent.StringPropertyheaderTextProperty()A property representing the header text for the dialog pane.ReadOnlyDoublePropertyheightProperty()Property representing the height of the dialog.voidhide()Hides thisDialog.voidinitModality(Modality modality)Specifies the modality for this dialog.voidinitOwner(Window window)Specifies the ownerWindowfor this dialog, or null for a top-level, unowned dialog.voidinitStyle(StageStyle style)Specifies the style for this dialog.booleanisResizable()Returns whether or not the dialog is resizable.booleanisShowing()Returns whether or not the dialog is showing.ObjectProperty<EventHandler<DialogEvent>>onCloseRequestProperty()Called when there is an external request to close thisDialog.ObjectProperty<EventHandler<DialogEvent>>onHiddenProperty()Called just after the Dialog has been hidden.ObjectProperty<EventHandler<DialogEvent>>onHidingProperty()Called just prior to the Dialog being hidden.ObjectProperty<EventHandler<DialogEvent>>onShowingProperty()Called just prior to the Dialog being shown.ObjectProperty<EventHandler<DialogEvent>>onShownProperty()Called just after the Dialog is shown.BooleanPropertyresizableProperty()Represents whether the dialog is resizable.ObjectProperty<Callback<ButtonType,R>>resultConverterProperty()API to convert theButtonTypethat the user clicked on into a result that can be returned via theresultproperty.ObjectProperty<R>resultProperty()A property representing what has been returned from the dialog.voidsetContentText(String contentText)Sets the string to show in the dialog content area.voidsetDialogPane(DialogPane value)Sets the value of the property dialogPane.voidsetGraphic(Node graphic)Sets the dialog graphic, which will be displayed either in the header, if one is showing, or to the left of thecontent.voidsetHeaderText(String headerText)Sets the string to show in the dialog header area.voidsetHeight(double height)Sets the height of the dialog.voidsetOnCloseRequest(EventHandler<DialogEvent> value)Sets the value of the property onCloseRequest.voidsetOnHidden(EventHandler<DialogEvent> value)Sets the value of the property onHidden.voidsetOnHiding(EventHandler<DialogEvent> value)Sets the value of the property onHiding.voidsetOnShowing(EventHandler<DialogEvent> value)Sets the value of the property onShowing.voidsetOnShown(EventHandler<DialogEvent> value)Sets the value of the property onShown.voidsetResizable(boolean resizable)Sets whether the dialog can be resized by the user.voidsetResult(R value)Sets the value of the property result.voidsetResultConverter(Callback<ButtonType,R> value)Sets the value of the property resultConverter.voidsetTitle(String title)Change the Title of the dialog.voidsetWidth(double width)Sets the width of the dialog.voidsetX(double x)Sets the value of the property x.voidsetY(double y)Sets the value of the property y.voidshow()Shows the dialog but does not wait for a user response (in other words, this brings up a non-blocking dialog).Optional<R>showAndWait()Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).ReadOnlyBooleanPropertyshowingProperty()Represents whether the dialog is currently showing.StringPropertytitleProperty()Return the titleProperty of the dialog.ReadOnlyDoublePropertywidthProperty()Property representing the width of the dialog.ReadOnlyDoublePropertyxProperty()The horizontal location of thisDialog.ReadOnlyDoublePropertyyProperty()The vertical location of thisDialog.
 
- 
- 
- 
Property Detail- 
dialogPanepublic final ObjectProperty<DialogPane> dialogPaneProperty The root node of the dialog, theDialogPanecontains all visual elements shown in the dialog. As such, it is possible to completely adjust the display of the dialog by modifying the existing dialog pane or creating a new one.- See Also:
- getDialogPane(),- setDialogPane(DialogPane)
 
 - 
contentTextpublic final StringProperty contentTextProperty A property representing the content text for the dialog pane. The content text is lower precedence than thecontent node, meaning that if both the content node and the contentText properties are set, the content text will not be displayed in a default DialogPane instance.- See Also:
- getContentText(),- setContentText(String)
 
 - 
headerTextpublic final StringProperty headerTextProperty A property representing the header text for the dialog pane. The header text is lower precedence than theheader node, meaning that if both the header node and the headerText properties are set, the header text will not be displayed in a default DialogPane instance.- See Also:
- getHeaderText(),- setHeaderText(String)
 
 - 
graphicpublic final ObjectProperty<Node> graphicProperty The dialog graphic, presented either in the header, if one is showing, or to the left of thecontent.- See Also:
- getGraphic(),- setGraphic(Node)
 
 - 
resultpublic final ObjectProperty<R> resultProperty A property representing what has been returned from the dialog. A result is generated through theresult converter, which is intended to convert from theButtonTypethat the user clicked on into a value of type R. Refer to theDialogclass JavaDoc for more details.- See Also:
- getResult(),- setResult(R)
 
 - 
resultConverterpublic final ObjectProperty<Callback<ButtonType,R>> resultConverterProperty API to convert theButtonTypethat the user clicked on into a result that can be returned via theresultproperty. This is necessary asButtonTyperepresents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.- See Also:
- getResultConverter(),- setResultConverter(Callback)
 
 - 
showingpublic final ReadOnlyBooleanProperty showingProperty Represents whether the dialog is currently showing.- See Also:
- isShowing()
 
 - 
resizablepublic final BooleanProperty resizableProperty Represents whether the dialog is resizable.- See Also:
- isResizable(),- setResizable(boolean)
 
 - 
widthpublic final ReadOnlyDoubleProperty widthProperty Property representing the width of the dialog.- See Also:
- getWidth(),- setWidth(double)
 
 - 
heightpublic final ReadOnlyDoubleProperty heightProperty Property representing the height of the dialog.- See Also:
- getHeight(),- setHeight(double)
 
 - 
titlepublic final StringProperty titleProperty Return the titleProperty of the dialog.- See Also:
- getTitle(),- setTitle(String)
 
 - 
xpublic final ReadOnlyDoubleProperty xProperty The horizontal location of thisDialog. Changing this attribute will move theDialoghorizontally.- See Also:
- getX(),- setX(double)
 
 - 
ypublic final ReadOnlyDoubleProperty yProperty The vertical location of thisDialog. Changing this attribute will move theDialogvertically.- See Also:
- getY(),- setY(double)
 
 - 
onShowingpublic final ObjectProperty<EventHandler<DialogEvent>> onShowingProperty Called just prior to the Dialog being shown.- See Also:
- getOnShowing(),- setOnShowing(EventHandler)
 
 - 
onShownpublic final ObjectProperty<EventHandler<DialogEvent>> onShownProperty Called just after the Dialog is shown.- See Also:
- getOnShown(),- setOnShown(EventHandler)
 
 - 
onHidingpublic final ObjectProperty<EventHandler<DialogEvent>> onHidingProperty Called just prior to the Dialog being hidden.- See Also:
- getOnHiding(),- setOnHiding(EventHandler)
 
 - 
onHiddenpublic final ObjectProperty<EventHandler<DialogEvent>> onHiddenProperty Called just after the Dialog has been hidden. When theDialogis hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when theAlertis closed.- See Also:
- getOnHidden(),- setOnHidden(EventHandler)
 
 - 
onCloseRequestpublic final ObjectProperty<EventHandler<DialogEvent>> onCloseRequestProperty Called when there is an external request to close thisDialog. The installed event handler can prevent dialog closing by consuming the received event.
 
- 
 - 
Method Detail- 
showpublic final void show() Shows the dialog but does not wait for a user response (in other words, this brings up a non-blocking dialog). Users of this API must either poll theresult property, or else add a listener to the result property to be informed of when it is set.- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
 
 - 
showAndWaitpublic final Optional<R> showAndWait() Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).This method must be called on the JavaFX Application thread. Additionally, it must either be called from an input event handler or from the run method of a Runnable passed to Platform.runLater. It must not be called during animation or layout processing.- Returns:
- An Optionalthat contains theresult. Refer to theDialogclass documentation for more detail.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- IllegalStateException- if this method is called during animation or layout processing.
 
 - 
closepublic final void close() Closes thisDialog. This call is equivalent tohide().
 - 
hidepublic final void hide() Hides thisDialog.
 - 
initModalitypublic final void initModality(Modality modality) Specifies the modality for this dialog. This must be done prior to making the dialog visible. The modality is one of: Modality.NONE, Modality.WINDOW_MODAL, or Modality.APPLICATION_MODAL.- Default value:
- Modality.APPLICATION_MODAL
- Parameters:
- modality- the modality for this dialog.
- Throws:
- IllegalStateException- if this property is set after the dialog has ever been made visible.
 
 - 
getModalitypublic final Modality getModality() Retrieves the modality attribute for this dialog.- Returns:
- the modality.
 
 - 
initStylepublic final void initStyle(StageStyle style) Specifies the style for this dialog. This must be done prior to making the dialog visible. The style is one of: StageStyle.DECORATED, StageStyle.UNDECORATED, StageStyle.TRANSPARENT, StageStyle.UTILITY, or StageStyle.UNIFIED.- Default value:
- StageStyle.DECORATED
- Parameters:
- style- the style for this dialog.
- Throws:
- IllegalStateException- if this property is set after the dialog has ever been made visible.
 
 - 
initOwnerpublic final void initOwner(Window window) Specifies the ownerWindowfor this dialog, or null for a top-level, unowned dialog. This must be done prior to making the dialog visible.- Default value:
- null
- Parameters:
- window- the owner- Windowfor this dialog.
- Throws:
- IllegalStateException- if this property is set after the dialog has ever been made visible.
 
 - 
getOwnerpublic final Window getOwner() Retrieves the owner Window for this dialog, or null for an unowned dialog.- Returns:
- the owner Window.
 
 - 
dialogPanePropertypublic final ObjectProperty<DialogPane> dialogPaneProperty() The root node of the dialog, theDialogPanecontains all visual elements shown in the dialog. As such, it is possible to completely adjust the display of the dialog by modifying the existing dialog pane or creating a new one.- See Also:
- getDialogPane(),- setDialogPane(DialogPane)
 
 - 
getDialogPanepublic final DialogPane getDialogPane() Gets the value of the property dialogPane.- Property description:
- The root node of the dialog, the DialogPanecontains all visual elements shown in the dialog. As such, it is possible to completely adjust the display of the dialog by modifying the existing dialog pane or creating a new one.
 
 - 
setDialogPanepublic final void setDialogPane(DialogPane value) Sets the value of the property dialogPane.- Property description:
- The root node of the dialog, the DialogPanecontains all visual elements shown in the dialog. As such, it is possible to completely adjust the display of the dialog by modifying the existing dialog pane or creating a new one.
 
 - 
contentTextPropertypublic final StringProperty contentTextProperty() A property representing the content text for the dialog pane. The content text is lower precedence than thecontent node, meaning that if both the content node and the contentText properties are set, the content text will not be displayed in a default DialogPane instance.- See Also:
- getContentText(),- setContentText(String)
 
 - 
getContentTextpublic final String getContentText() Returns the currently-set content text for this DialogPane.- Returns:
- the currently-set content text for this DialogPane
 
 - 
setContentTextpublic final void setContentText(String contentText) Sets the string to show in the dialog content area. Note that the content text is lower precedence than thecontent node, meaning that if both the content node and the contentText properties are set, the content text will not be displayed in a default DialogPane instance.- Parameters:
- contentText- the string to show in the dialog content area
 
 - 
headerTextPropertypublic final StringProperty headerTextProperty() A property representing the header text for the dialog pane. The header text is lower precedence than theheader node, meaning that if both the header node and the headerText properties are set, the header text will not be displayed in a default DialogPane instance.- See Also:
- getHeaderText(),- setHeaderText(String)
 
 - 
getHeaderTextpublic final String getHeaderText() Returns the currently-set header text for this DialogPane.- Returns:
- the currently-set header text for this DialogPane
 
 - 
setHeaderTextpublic final void setHeaderText(String headerText) Sets the string to show in the dialog header area. Note that the header text is lower precedence than theheader node, meaning that if both the header node and the headerText properties are set, the header text will not be displayed in a default DialogPane instance.- Parameters:
- headerText- the string to show in the dialog header area
 
 - 
graphicPropertypublic final ObjectProperty<Node> graphicProperty() The dialog graphic, presented either in the header, if one is showing, or to the left of thecontent.- See Also:
- getGraphic(),- setGraphic(Node)
 
 - 
getGraphicpublic final Node getGraphic() Gets the value of the property graphic.- Property description:
- The dialog graphic, presented either in the header, if one is showing, or
 to the left of the content.
 
 - 
setGraphicpublic final void setGraphic(Node graphic) Sets the dialog graphic, which will be displayed either in the header, if one is showing, or to the left of thecontent.- Parameters:
- graphic- The new dialog graphic, or null if no graphic should be shown.
 
 - 
resultPropertypublic final ObjectProperty<R> resultProperty() A property representing what has been returned from the dialog. A result is generated through theresult converter, which is intended to convert from theButtonTypethat the user clicked on into a value of type R. Refer to theDialogclass JavaDoc for more details.- See Also:
- getResult(),- setResult(R)
 
 - 
getResultpublic final R getResult() Gets the value of the property result.- Property description:
- A property representing what has been returned from the dialog. A result
 is generated through the result converter, which is intended to convert from theButtonTypethat the user clicked on into a value of type R. Refer to theDialogclass JavaDoc for more details.
 
 - 
setResultpublic final void setResult(R value) Sets the value of the property result.- Property description:
- A property representing what has been returned from the dialog. A result
 is generated through the result converter, which is intended to convert from theButtonTypethat the user clicked on into a value of type R. Refer to theDialogclass JavaDoc for more details.
 
 - 
resultConverterPropertypublic final ObjectProperty<Callback<ButtonType,R>> resultConverterProperty() API to convert theButtonTypethat the user clicked on into a result that can be returned via theresultproperty. This is necessary asButtonTyperepresents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.- See Also:
- getResultConverter(),- setResultConverter(Callback)
 
 - 
getResultConverterpublic final Callback<ButtonType,R> getResultConverter() Gets the value of the property resultConverter.- Property description:
- API to convert the ButtonTypethat the user clicked on into a result that can be returned via theresultproperty. This is necessary asButtonTyperepresents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.
 
 - 
setResultConverterpublic final void setResultConverter(Callback<ButtonType,R> value) Sets the value of the property resultConverter.- Property description:
- API to convert the ButtonTypethat the user clicked on into a result that can be returned via theresultproperty. This is necessary asButtonTyperepresents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.
 
 - 
showingPropertypublic final ReadOnlyBooleanProperty showingProperty() Represents whether the dialog is currently showing.- See Also:
- isShowing()
 
 - 
isShowingpublic final boolean isShowing() Returns whether or not the dialog is showing.- Returns:
- true if dialog is showing.
 
 - 
resizablePropertypublic final BooleanProperty resizableProperty() Represents whether the dialog is resizable.- See Also:
- isResizable(),- setResizable(boolean)
 
 - 
isResizablepublic final boolean isResizable() Returns whether or not the dialog is resizable.- Returns:
- true if dialog is resizable.
 
 - 
setResizablepublic final void setResizable(boolean resizable) Sets whether the dialog can be resized by the user. Resizable dialogs can also be maximized ( maximize button becomes visible)- Parameters:
- resizable- true if dialog should be resizable.
 
 - 
widthPropertypublic final ReadOnlyDoubleProperty widthProperty() Property representing the width of the dialog.- See Also:
- getWidth(),- setWidth(double)
 
 - 
getWidthpublic final double getWidth() Returns the width of the dialog.- Returns:
- the width of the dialog
 
 - 
setWidthpublic final void setWidth(double width) Sets the width of the dialog.- Parameters:
- width- the width of the dialog
 
 - 
heightPropertypublic final ReadOnlyDoubleProperty heightProperty() Property representing the height of the dialog.- See Also:
- getHeight(),- setHeight(double)
 
 - 
getHeightpublic final double getHeight() Returns the height of the dialog.- Returns:
- the height of the dialog
 
 - 
setHeightpublic final void setHeight(double height) Sets the height of the dialog.- Parameters:
- height- the height of the dialog
 
 - 
titlePropertypublic final StringProperty titleProperty() Return the titleProperty of the dialog.- See Also:
- getTitle(),- setTitle(String)
 
 - 
getTitlepublic final String getTitle() Return the title of the dialog.- Returns:
- the title of the dialog
 
 - 
setTitlepublic final void setTitle(String title) Change the Title of the dialog.- Parameters:
- title- the Title of the dialog
 
 - 
getXpublic final double getX() Gets the value of the property x.- Property description:
- The horizontal location of this Dialog. Changing this attribute will move theDialoghorizontally.
 
 - 
setXpublic final void setX(double x) Sets the value of the property x.- Property description:
- The horizontal location of this Dialog. Changing this attribute will move theDialoghorizontally.
 
 - 
xPropertypublic final ReadOnlyDoubleProperty xProperty() The horizontal location of thisDialog. Changing this attribute will move theDialoghorizontally.- See Also:
- getX(),- setX(double)
 
 - 
getYpublic final double getY() Gets the value of the property y.- Property description:
- The vertical location of this Dialog. Changing this attribute will move theDialogvertically.
 
 - 
setYpublic final void setY(double y) Sets the value of the property y.- Property description:
- The vertical location of this Dialog. Changing this attribute will move theDialogvertically.
 
 - 
yPropertypublic final ReadOnlyDoubleProperty yProperty() The vertical location of thisDialog. Changing this attribute will move theDialogvertically.- See Also:
- getY(),- setY(double)
 
 - 
buildEventDispatchChainpublic EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at thisEventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add anEventDispatcherfor itself to the chain.In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target. The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain. The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain. - Specified by:
- buildEventDispatchChainin interface- EventTarget
- Parameters:
- tail- the initial chain to build from
- Returns:
- the resulting event dispatch chain for this target
 
 - 
setOnShowingpublic final void setOnShowing(EventHandler<DialogEvent> value) Sets the value of the property onShowing.- Property description:
- Called just prior to the Dialog being shown.
 
 - 
getOnShowingpublic final EventHandler<DialogEvent> getOnShowing() Gets the value of the property onShowing.- Property description:
- Called just prior to the Dialog being shown.
 
 - 
onShowingPropertypublic final ObjectProperty<EventHandler<DialogEvent>> onShowingProperty() Called just prior to the Dialog being shown.- See Also:
- getOnShowing(),- setOnShowing(EventHandler)
 
 - 
setOnShownpublic final void setOnShown(EventHandler<DialogEvent> value) Sets the value of the property onShown.- Property description:
- Called just after the Dialog is shown.
 
 - 
getOnShownpublic final EventHandler<DialogEvent> getOnShown() Gets the value of the property onShown.- Property description:
- Called just after the Dialog is shown.
 
 - 
onShownPropertypublic final ObjectProperty<EventHandler<DialogEvent>> onShownProperty() Called just after the Dialog is shown.- See Also:
- getOnShown(),- setOnShown(EventHandler)
 
 - 
setOnHidingpublic final void setOnHiding(EventHandler<DialogEvent> value) Sets the value of the property onHiding.- Property description:
- Called just prior to the Dialog being hidden.
 
 - 
getOnHidingpublic final EventHandler<DialogEvent> getOnHiding() Gets the value of the property onHiding.- Property description:
- Called just prior to the Dialog being hidden.
 
 - 
onHidingPropertypublic final ObjectProperty<EventHandler<DialogEvent>> onHidingProperty() Called just prior to the Dialog being hidden.- See Also:
- getOnHiding(),- setOnHiding(EventHandler)
 
 - 
setOnHiddenpublic final void setOnHidden(EventHandler<DialogEvent> value) Sets the value of the property onHidden.- Property description:
- Called just after the Dialog has been hidden.
 When the Dialogis hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when theAlertis closed.
 
 - 
getOnHiddenpublic final EventHandler<DialogEvent> getOnHidden() Gets the value of the property onHidden.- Property description:
- Called just after the Dialog has been hidden.
 When the Dialogis hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when theAlertis closed.
 
 - 
onHiddenPropertypublic final ObjectProperty<EventHandler<DialogEvent>> onHiddenProperty() Called just after the Dialog has been hidden. When theDialogis hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when theAlertis closed.- See Also:
- getOnHidden(),- setOnHidden(EventHandler)
 
 - 
setOnCloseRequestpublic final void setOnCloseRequest(EventHandler<DialogEvent> value) Sets the value of the property onCloseRequest.- Property description:
- Called when there is an external request to close this Dialog. The installed event handler can prevent dialog closing by consuming the received event.
 
 - 
getOnCloseRequestpublic final EventHandler<DialogEvent> getOnCloseRequest() Gets the value of the property onCloseRequest.- Property description:
- Called when there is an external request to close this Dialog. The installed event handler can prevent dialog closing by consuming the received event.
 
 - 
onCloseRequestPropertypublic final ObjectProperty<EventHandler<DialogEvent>> onCloseRequestProperty() Called when there is an external request to close thisDialog. The installed event handler can prevent dialog closing by consuming the received event.
 
- 
 
-