Module javafx.controls
Package javafx.scene.control

# Class Dialog<R>

java.lang.Object
javafx.scene.control.Dialog<R>

Type Parameters:
  `R` - The return type of the dialog, via the `result` property.

All Implemented Interfaces:
  `EventTarget`

Direct Known Subclasses:
  `Alert`, `ChoiceDialog`, `TextInputDialog`

public class Dialog<R> extends Object implements EventTarget
A Dialog in JavaFX wraps a `DialogPane` and provides the necessary API to present it to end users. In JavaFX 8u40, this essentially means that the `DialogPane` is shown to users inside a `Stage`, 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 `result` property (and also, how to convert from `ButtonType` to R, through the use of the `result converter` `Callback`).

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 converter` property. A result converter must always be set, whenever the R type is not `Void` or `ButtonType`. If this is not heeded, developers will find that they get ClassCastExceptions in their code, for failure to convert from `ButtonType` via the `result converter`.

It is likely that most developers would be better served using either the `Alert` class (for pre-defined, notification-style alerts), or either of the two pre-built dialogs (`TextInputDialog` and `ChoiceDialog`), 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()`, and `graphicProperty()`, and these properties are simply forwarding API onto the respective properties on the `DialogPane` stored in the `dialog pane` property. 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 of `dialog.getDialogPane().setExpandableContent(node)`.

After configuring these properties, all that remains is to consider whether the buttons (created using `ButtonType` and the `DialogPane.createButton(ButtonType)` method) are fully configured. Developers will quickly find that the amount of configurability offered via the `ButtonType` class is minimal. This is intentional, but does not mean that developers can not modify the buttons created by the `ButtonType` that have been specified. To do this, developers simply call the `DialogPane.lookupButton(ButtonType)` method with the ButtonType (assuming it has already been set in the `DialogPane.getButtonTypes()` list. The returned Node is typically of type `Button`, but this depends on if the `DialogPane.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 call `showAndWait()` or `show()` (respectively). By default most developers should choose to use `showAndWait()`, 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 `Optional` API, which is new in Java 8 and may be foreign to many developers.

## Dialog Validation / Intercepting Button Actions

In 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 a `ButtonType` (that has already been set in the `button types` list), users will be returned a Node that is typically of type `Button` (but this depends on if the `DialogPane.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 by `consuming` the 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 Rules

It 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:
  1. When the dialog only has one button, or
  2. When the dialog has multiple buttons, as long as one of them meets one of the following requirements:
     1. The button has a `ButtonType` whose `ButtonBar.ButtonData` is of type `ButtonBar.ButtonData.CANCEL_CLOSE`.
     2. The button has a `ButtonType` whose `ButtonBar.ButtonData` returns true when `ButtonBar.ButtonData.isCancelButton()` is called.
- 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 `DialogPane` area 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 `result` property to whatever value is returned from calling the `result converter` with the first matching `ButtonType`.
- If for any reason the result converter returns null, or if the dialog is closed when only one non-cancel button is present, the `result` property will be null, and the `showAndWait()` method will return `Optional.empty()`. This later point means that, if you use either of option 2 or option 3 (as presented earlier in this class documentation), the `Optional.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 Summary

  Properties
  Type
  Property
  Description
  `final StringProperty`
  `contentText`
  A property representing the content text for the dialog pane.
  `final ObjectProperty<DialogPane>`
  `dialogPane`
  The root node of the dialog, the `DialogPane` contains all visual elements shown in the dialog.
  `final ObjectProperty<Node>`
  `graphic`
  The dialog graphic, presented either in the header, if one is showing, or to the left of the `content`.
  `final StringProperty`
  `headerText`
  A property representing the header text for the dialog pane.
  `final ReadOnlyDoubleProperty`
  `height`
  Property representing the height of the dialog.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onCloseRequest`
  Called when there is an external request to close this `Dialog`.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onHidden`
  Called just after the Dialog has been hidden.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onHiding`
  Called just prior to the Dialog being hidden.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onShowing`
  Called just prior to the Dialog being shown.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onShown`
  Called just after the Dialog is shown.
  `final BooleanProperty`
  `resizable`
  Represents whether the dialog is resizable.
  `final ObjectProperty<Callback<ButtonType,R>>`
  `resultConverter`
  API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property.
  `final ObjectProperty<R>`
  `result`
  A property representing what has been returned from the dialog.
  `final ReadOnlyBooleanProperty`
  `showing`
  Represents whether the dialog is currently showing.
  `final StringProperty`
  `title`
  Return the titleProperty of the dialog.
  `final ReadOnlyDoubleProperty`
  `width`
  Property representing the width of the dialog.
  `final ReadOnlyDoubleProperty`
  `x`
  The horizontal location of this `Dialog`.
  `final ReadOnlyDoubleProperty`
  `y`
  The vertical location of this `Dialog`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Dialog()`
  Creates a dialog without a specified owner.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final <E extends Event>
  void`
  `addEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)`
  Registers an event filter for this target.
  `final <E extends Event>
  void`
  `addEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)`
  Registers an event handler for this target.
  `EventDispatchChain`
  `buildEventDispatchChain(EventDispatchChain tail)`
  Construct an event dispatch chain for this target.
  `final void`
  `close()`
  Closes this `Dialog`.
  `final StringProperty`
  `contentTextProperty()`
  A property representing the content text for the dialog pane.
  `final ObjectProperty<DialogPane>`
  `dialogPaneProperty()`
  The root node of the dialog, the `DialogPane` contains all visual elements shown in the dialog.
  `final String`
  `getContentText()`
  Returns the currently-set content text for this DialogPane.
  `final DialogPane`
  `getDialogPane()`
  Gets the value of the `dialogPane` property.
  `final Node`
  `getGraphic()`
  Gets the value of the `graphic` property.
  `final String`
  `getHeaderText()`
  Returns the currently-set header text for this DialogPane.
  `final double`
  `getHeight()`
  Returns the height of the dialog.
  `final Modality`
  `getModality()`
  Retrieves the modality attribute for this dialog.
  `final EventHandler<DialogEvent>`
  `getOnCloseRequest()`
  Gets the value of the `onCloseRequest` property.
  `final EventHandler<DialogEvent>`
  `getOnHidden()`
  Gets the value of the `onHidden` property.
  `final EventHandler<DialogEvent>`
  `getOnHiding()`
  Gets the value of the `onHiding` property.
  `final EventHandler<DialogEvent>`
  `getOnShowing()`
  Gets the value of the `onShowing` property.
  `final EventHandler<DialogEvent>`
  `getOnShown()`
  Gets the value of the `onShown` property.
  `final Window`
  `getOwner()`
  Retrieves the owner Window for this dialog, or null for an unowned dialog.
  `final R`
  `getResult()`
  Gets the value of the `result` property.
  `final Callback<ButtonType,R>`
  `getResultConverter()`
  Gets the value of the `resultConverter` property.
  `final String`
  `getTitle()`
  Return the title of the dialog.
  `final double`
  `getWidth()`
  Returns the width of the dialog.
  `final double`
  `getX()`
  Gets the value of the `x` property.
  `final double`
  `getY()`
  Gets the value of the `y` property.
  `final ObjectProperty<Node>`
  `graphicProperty()`
  The dialog graphic, presented either in the header, if one is showing, or to the left of the `content`.
  `final StringProperty`
  `headerTextProperty()`
  A property representing the header text for the dialog pane.
  `final ReadOnlyDoubleProperty`
  `heightProperty()`
  Property representing the height of the dialog.
  `final void`
  `hide()`
  Hides this `Dialog`.
  `final void`
  `initModality(Modality modality)`
  Specifies the modality for this dialog.
  `final void`
  `initOwner(Window window)`
  Specifies the owner `Window` for this dialog, or null for a top-level, unowned dialog.
  `final void`
  `initStyle(StageStyle style)`
  Specifies the style for this dialog.
  `final boolean`
  `isResizable()`
  Returns whether or not the dialog is resizable.
  `final boolean`
  `isShowing()`
  Returns whether or not the dialog is showing.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onCloseRequestProperty()`
  Called when there is an external request to close this `Dialog`.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onHiddenProperty()`
  Called just after the Dialog has been hidden.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onHidingProperty()`
  Called just prior to the Dialog being hidden.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onShowingProperty()`
  Called just prior to the Dialog being shown.
  `final ObjectProperty<EventHandler<DialogEvent>>`
  `onShownProperty()`
  Called just after the Dialog is shown.
  `final <E extends Event>
  void`
  `removeEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)`
  Unregisters a previously registered event filter from this target.
  `final <E extends Event>
  void`
  `removeEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)`
  Unregisters a previously registered event handler from this target.
  `final BooleanProperty`
  `resizableProperty()`
  Represents whether the dialog is resizable.
  `final ObjectProperty<Callback<ButtonType,R>>`
  `resultConverterProperty()`
  API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property.
  `final ObjectProperty<R>`
  `resultProperty()`
  A property representing what has been returned from the dialog.
  `final void`
  `setContentText(String contentText)`
  Sets the string to show in the dialog content area.
  `final void`
  `setDialogPane(DialogPane value)`
  Sets the value of the `dialogPane` property.
  `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 the `content`.
  `final void`
  `setHeaderText(String headerText)`
  Sets the string to show in the dialog header area.
  `final void`
  `setHeight(double height)`
  Sets the height of the dialog.
  `final void`
  `setOnCloseRequest(EventHandler<DialogEvent> value)`
  Sets the value of the `onCloseRequest` property.
  `final void`
  `setOnHidden(EventHandler<DialogEvent> value)`
  Sets the value of the `onHidden` property.
  `final void`
  `setOnHiding(EventHandler<DialogEvent> value)`
  Sets the value of the `onHiding` property.
  `final void`
  `setOnShowing(EventHandler<DialogEvent> value)`
  Sets the value of the `onShowing` property.
  `final void`
  `setOnShown(EventHandler<DialogEvent> value)`
  Sets the value of the `onShown` property.
  `final void`
  `setResizable(boolean resizable)`
  Sets whether the dialog can be resized by the user.
  `final void`
  `setResult(R value)`
  Sets the value of the `result` property.
  `final void`
  `setResultConverter(Callback<ButtonType,R> value)`
  Sets the value of the `resultConverter` property.
  `final void`
  `setTitle(String title)`
  Change the Title of the dialog.
  `final void`
  `setWidth(double width)`
  Sets the width of the dialog.
  `final void`
  `setX(double x)`
  Sets the value of the `x` property.
  `final void`
  `setY(double y)`
  Sets the value of the `y` property.
  `final void`
  `show()`
  Shows the dialog but does not wait for a user response (in other words, this brings up a non-blocking dialog).
  `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).
  `final ReadOnlyBooleanProperty`
  `showingProperty()`
  Represents whether the dialog is currently showing.
  `final StringProperty`
  `titleProperty()`
  Return the titleProperty of the dialog.
  `final ReadOnlyDoubleProperty`
  `widthProperty()`
  Property representing the width of the dialog.
  `final ReadOnlyDoubleProperty`
  `xProperty()`
  The horizontal location of this `Dialog`.
  `final ReadOnlyDoubleProperty`
  `yProperty()`
  The vertical location of this `Dialog`.

  ### Methods declared in class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Property Details

  - ### dialogPane

    public final ObjectProperty<DialogPane> dialogPaneProperty
    The root node of the dialog, the `DialogPane` contains 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)`
      - `dialogPaneProperty()`

  - ### contentText

    public final StringProperty contentTextProperty
    A property representing the content text for the dialog pane. The content text is lower precedence than the `content 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)`
      - `contentTextProperty()`

  - ### headerText

    public final StringProperty headerTextProperty
    A property representing the header text for the dialog pane. The header text is lower precedence than the `header 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)`
      - `headerTextProperty()`

  - ### graphic

    public final ObjectProperty<Node> graphicProperty
    The dialog graphic, presented either in the header, if one is showing, or to the left of the `content`.
    See Also:
      - `getGraphic()`
      - `setGraphic(Node)`
      - `graphicProperty()`

  - ### result

    public final ObjectProperty<R> resultProperty
    A property representing what has been returned from the dialog. A result is generated through the `result converter`, which is intended to convert from the `ButtonType` that the user clicked on into a value of type R. Refer to the `Dialog` class JavaDoc for more details.
    See Also:
      - `getResult()`
      - `setResult(R)`
      - `resultProperty()`

  - ### resultConverter

    public final ObjectProperty<Callback<ButtonType,R>> resultConverterProperty
    API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property. This is necessary as `ButtonType` represents 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)`
      - `resultConverterProperty()`

  - ### showing

    public final ReadOnlyBooleanProperty showingProperty
    Represents whether the dialog is currently showing.
    See Also:
      - `isShowing()`
      - `showingProperty()`

  - ### resizable

    public final BooleanProperty resizableProperty
    Represents whether the dialog is resizable.
    See Also:
      - `isResizable()`
      - `setResizable(boolean)`
      - `resizableProperty()`

  - ### width

    public final ReadOnlyDoubleProperty widthProperty
    Property representing the width of the dialog.
    See Also:
      - `getWidth()`
      - `setWidth(double)`
      - `widthProperty()`

  - ### height

    public final ReadOnlyDoubleProperty heightProperty
    Property representing the height of the dialog.
    See Also:
      - `getHeight()`
      - `setHeight(double)`
      - `heightProperty()`

  - ### title

    public final StringProperty titleProperty
    Return the titleProperty of the dialog.
    See Also:
      - `getTitle()`
      - `setTitle(String)`
      - `titleProperty()`

  - ### x

    public final ReadOnlyDoubleProperty xProperty
    The horizontal location of this `Dialog`. Changing this attribute will move the `Dialog` horizontally.
    See Also:
      - `getX()`
      - `setX(double)`
      - `xProperty()`

  - ### y

    public final ReadOnlyDoubleProperty yProperty
    The vertical location of this `Dialog`. Changing this attribute will move the `Dialog` vertically.
    See Also:
      - `getY()`
      - `setY(double)`
      - `yProperty()`

  - ### onShowing

    public final ObjectProperty<EventHandler<DialogEvent>> onShowingProperty
    Called just prior to the Dialog being shown.
    See Also:
      - `getOnShowing()`
      - `setOnShowing(EventHandler)`
      - `onShowingProperty()`

  - ### onShown

    public final ObjectProperty<EventHandler<DialogEvent>> onShownProperty
    Called just after the Dialog is shown.
    See Also:
      - `getOnShown()`
      - `setOnShown(EventHandler)`
      - `onShownProperty()`

  - ### onHiding

    public final ObjectProperty<EventHandler<DialogEvent>> onHidingProperty
    Called just prior to the Dialog being hidden.
    See Also:
      - `getOnHiding()`
      - `setOnHiding(EventHandler)`
      - `onHidingProperty()`

  - ### onHidden

    public final ObjectProperty<EventHandler<DialogEvent>> onHiddenProperty
    Called just after the Dialog has been hidden. When the `Dialog` is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the `Alert` is closed.
    See Also:
      - `getOnHidden()`
      - `setOnHidden(EventHandler)`
      - `onHiddenProperty()`

  - ### onCloseRequest

    public final ObjectProperty<EventHandler<DialogEvent>> onCloseRequestProperty
    Called when there is an external request to close this `Dialog`. The installed event handler can prevent dialog closing by consuming the received event.
    See Also:
      - `getOnCloseRequest()`
      - `setOnCloseRequest(EventHandler)`
      - `onCloseRequestProperty()`

- ## Constructor Details

  - ### Dialog

    public Dialog()
    Creates a dialog without a specified owner.

- ## Method Details

  - ### show

    public 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 the `result 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.

  - ### showAndWait

    public 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 `Optional` that contains the `result`. Refer to the `Dialog` class 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.

  - ### close

    public final void close()
    Closes this `Dialog`. This call is equivalent to `hide()`.

  - ### hide

    public final void hide()
    Hides this `Dialog`.

  - ### initModality

    public 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.

  - ### getModality

    public final Modality getModality()
    Retrieves the modality attribute for this dialog.
    Returns:
      the modality.

  - ### initStyle

    public 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.

  - ### initOwner

    public final void initOwner(Window window)
    Specifies the owner `Window` for 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 `Window` for this dialog.
    Throws:
      `IllegalStateException` - if this property is set after the dialog has ever been made visible.

  - ### getOwner

    public final Window getOwner()
    Retrieves the owner Window for this dialog, or null for an unowned dialog.
    Returns:
      the owner Window.

  - ### dialogPaneProperty

    public final ObjectProperty<DialogPane> dialogPaneProperty()
    The root node of the dialog, the `DialogPane` contains 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.
    Returns:
      the `dialogPane` property
    See Also:
      - `getDialogPane()`
      - `setDialogPane(DialogPane)`

  - ### getDialogPane

    public final DialogPane getDialogPane()
    Gets the value of the `dialogPane` property.
    Property description:
      The root node of the dialog, the `DialogPane` contains 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.
    Returns:
      the value of the `dialogPane` property
    See Also:
      - `setDialogPane(DialogPane)`
      - `dialogPaneProperty()`

  - ### setDialogPane

    public final void setDialogPane(DialogPane value)
    Sets the value of the `dialogPane` property.
    Property description:
      The root node of the dialog, the `DialogPane` contains 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.
    Parameters:
      `value` - the value for the `dialogPane` property
    See Also:
      - `getDialogPane()`
      - `dialogPaneProperty()`

  - ### contentTextProperty

    public final StringProperty contentTextProperty()
    A property representing the content text for the dialog pane. The content text is lower precedence than the `content 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.
    Returns:
      the property representing the content text for the dialog pane
    See Also:
      - `getContentText()`
      - `setContentText(String)`

  - ### getContentText

    public final String getContentText()
    Returns the currently-set content text for this DialogPane.
    Returns:
      the currently-set content text for this DialogPane

  - ### setContentText

    public final void setContentText(String contentText)
    Sets the string to show in the dialog content area. Note that the content text is lower precedence than the `content 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

  - ### headerTextProperty

    public final StringProperty headerTextProperty()
    A property representing the header text for the dialog pane. The header text is lower precedence than the `header 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.
    Returns:
      a property representing the header text for the dialog pane
    See Also:
      - `getHeaderText()`
      - `setHeaderText(String)`

  - ### getHeaderText

    public final String getHeaderText()
    Returns the currently-set header text for this DialogPane.
    Returns:
      the currently-set header text for this DialogPane

  - ### setHeaderText

    public final void setHeaderText(String headerText)
    Sets the string to show in the dialog header area. Note that the header text is lower precedence than the `header 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

  - ### graphicProperty

    public final ObjectProperty<Node> graphicProperty()
    The dialog graphic, presented either in the header, if one is showing, or to the left of the `content`.
    Returns:
      An ObjectProperty wrapping the current graphic.
    See Also:
      - `getGraphic()`
      - `setGraphic(Node)`

  - ### getGraphic

    public final Node getGraphic()
    Gets the value of the `graphic` property.
    Property description:
      The dialog graphic, presented either in the header, if one is showing, or to the left of the `content`.
    Returns:
      the value of the `graphic` property
    See Also:
      - `setGraphic(Node)`
      - `graphicProperty()`

  - ### setGraphic

    public 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 the `content`.
    Parameters:
      `graphic` - The new dialog graphic, or null if no graphic should be shown.

  - ### resultProperty

    public final ObjectProperty<R> resultProperty()
    A property representing what has been returned from the dialog. A result is generated through the `result converter`, which is intended to convert from the `ButtonType` that the user clicked on into a value of type R. Refer to the `Dialog` class JavaDoc for more details.
    Returns:
      a property representing what has been returned from the dialog
    See Also:
      - `getResult()`
      - `setResult(R)`

  - ### getResult

    public final R getResult()
    Gets the value of the `result` property.
    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 the `ButtonType` that the user clicked on into a value of type R. Refer to the `Dialog` class JavaDoc for more details.
    Returns:
      the value of the `result` property
    See Also:
      - `setResult(R)`
      - `resultProperty()`

  - ### setResult

    public final void setResult(R value)
    Sets the value of the `result` property.
    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 the `ButtonType` that the user clicked on into a value of type R. Refer to the `Dialog` class JavaDoc for more details.
    Parameters:
      `value` - the value for the `result` property
    See Also:
      - `getResult()`
      - `resultProperty()`

  - ### resultConverterProperty

    public final ObjectProperty<Callback<ButtonType,R>> resultConverterProperty()
    API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property. This is necessary as `ButtonType` represents 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.
    Returns:
      the API to convert the `ButtonType` that the user clicked on
    See Also:
      - `getResultConverter()`
      - `setResultConverter(Callback)`

  - ### getResultConverter

    public final Callback<ButtonType,R> getResultConverter()
    Gets the value of the `resultConverter` property.
    Property description:
      API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property. This is necessary as `ButtonType` represents 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.
    Returns:
      the value of the `resultConverter` property
    See Also:
      - `setResultConverter(Callback)`
      - `resultConverterProperty()`

  - ### setResultConverter

    public final void setResultConverter(Callback<ButtonType,R> value)
    Sets the value of the `resultConverter` property.
    Property description:
      API to convert the `ButtonType` that the user clicked on into a result that can be returned via the `result` property. This is necessary as `ButtonType` represents 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.
    Parameters:
      `value` - the value for the `resultConverter` property
    See Also:
      - `getResultConverter()`
      - `resultConverterProperty()`

  - ### showingProperty

    public final ReadOnlyBooleanProperty showingProperty()
    Represents whether the dialog is currently showing.
    Returns:
      the property representing whether the dialog is currently showing
    See Also:
      - `isShowing()`

  - ### isShowing

    public final boolean isShowing()
    Returns whether or not the dialog is showing.
    Returns:
      true if dialog is showing.

  - ### resizableProperty

    public final BooleanProperty resizableProperty()
    Represents whether the dialog is resizable.
    Returns:
      the property representing whether the dialog is resizable
    See Also:
      - `isResizable()`
      - `setResizable(boolean)`

  - ### isResizable

    public final boolean isResizable()
    Returns whether or not the dialog is resizable.
    Returns:
      true if dialog is resizable.

  - ### setResizable

    public 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.

  - ### widthProperty

    public final ReadOnlyDoubleProperty widthProperty()
    Property representing the width of the dialog.
    Returns:
      the property representing the width of the dialog
    See Also:
      - `getWidth()`
      - `setWidth(double)`

  - ### getWidth

    public final double getWidth()
    Returns the width of the dialog.
    Returns:
      the width of the dialog

  - ### setWidth

    public final void setWidth(double width)
    Sets the width of the dialog.
    Parameters:
      `width` - the width of the dialog

  - ### heightProperty

    public final ReadOnlyDoubleProperty heightProperty()
    Property representing the height of the dialog.
    Returns:
      the property representing the height of the dialog
    See Also:
      - `getHeight()`
      - `setHeight(double)`

  - ### getHeight

    public final double getHeight()
    Returns the height of the dialog.
    Returns:
      the height of the dialog

  - ### setHeight

    public final void setHeight(double height)
    Sets the height of the dialog.
    Parameters:
      `height` - the height of the dialog

  - ### titleProperty

    public final StringProperty titleProperty()
    Return the titleProperty of the dialog.
    Returns:
      the titleProperty of the dialog
    See Also:
      - `getTitle()`
      - `setTitle(String)`

  - ### getTitle

    public final String getTitle()
    Return the title of the dialog.
    Returns:
      the title of the dialog

  - ### setTitle

    public final void setTitle(String title)
    Change the Title of the dialog.
    Parameters:
      `title` - the Title of the dialog

  - ### getX

    public final double getX()
    Gets the value of the `x` property.
    Property description:
      The horizontal location of this `Dialog`. Changing this attribute will move the `Dialog` horizontally.
    Returns:
      the value of the `x` property
    See Also:
      - `setX(double)`
      - `xProperty()`

  - ### setX

    public final void setX(double x)
    Sets the value of the `x` property.
    Property description:
      The horizontal location of this `Dialog`. Changing this attribute will move the `Dialog` horizontally.
    Parameters:
      `x` - the value for the `x` property
    See Also:
      - `getX()`
      - `xProperty()`

  - ### xProperty

    public final ReadOnlyDoubleProperty xProperty()
    The horizontal location of this `Dialog`. Changing this attribute will move the `Dialog` horizontally.
    Returns:
      the horizontal location of this `Dialog`
    See Also:
      - `getX()`
      - `setX(double)`

  - ### getY

    public final double getY()
    Gets the value of the `y` property.
    Property description:
      The vertical location of this `Dialog`. Changing this attribute will move the `Dialog` vertically.
    Returns:
      the value of the `y` property
    See Also:
      - `setY(double)`
      - `yProperty()`

  - ### setY

    public final void setY(double y)
    Sets the value of the `y` property.
    Property description:
      The vertical location of this `Dialog`. Changing this attribute will move the `Dialog` vertically.
    Parameters:
      `y` - the value for the `y` property
    See Also:
      - `getY()`
      - `yProperty()`

  - ### yProperty

    public final ReadOnlyDoubleProperty yProperty()
    The vertical location of this `Dialog`. Changing this attribute will move the `Dialog` vertically.
    Returns:
      the vertical location of this `Dialog`
    See Also:
      - `getY()`
      - `setY(double)`

  - ### buildEventDispatchChain

    public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
    Description copied from interface: `EventTarget`
    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 this `EventTarget`. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an `EventDispatcher` for 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:
      `buildEventDispatchChain` in interface `EventTarget`
    Parameters:
      `tail` - the initial chain to build from
    Returns:
      the resulting event dispatch chain for this target

  - ### addEventHandler

    public final <E extends Event> void addEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)
    Description copied from interface: `EventTarget`
    Registers an event handler for this target.

    The handler is called when the target receives an `Event` of the specified type during the bubbling phase of event delivery.

    Specified by:
      `addEventHandler` in interface `EventTarget`
    Type Parameters:
      `E` - the event class of the handler
    Parameters:
      `eventType` - the type of the events received by the handler
      `eventHandler` - the event handler

  - ### removeEventHandler

    public final <E extends Event> void removeEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)
    Description copied from interface: `EventTarget`
    Unregisters a previously registered event handler from this target.

    Since it is possible to register a single `EventHandler` instance for different event types, the caller needs to specify the event type from which the handler should be unregistered.

    Specified by:
      `removeEventHandler` in interface `EventTarget`
    Type Parameters:
      `E` - the event class of the handler
    Parameters:
      `eventType` - the event type from which to unregister
      `eventHandler` - the event handler

  - ### addEventFilter

    public final <E extends Event> void addEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)
    Description copied from interface: `EventTarget`
    Registers an event filter for this target.

    The filter is called when the target receives an `Event` of the specified type during the capturing phase of event delivery.

    Specified by:
      `addEventFilter` in interface `EventTarget`
    Type Parameters:
      `E` - the event class of the filter
    Parameters:
      `eventType` - the type of the events received by the filter
      `eventFilter` - the event filter

  - ### removeEventFilter

    public final <E extends Event> void removeEventFilter(EventType<E> eventType, EventHandler<? super E> eventFilter)
    Description copied from interface: `EventTarget`
    Unregisters a previously registered event filter from this target.

    Since it is possible to register a single `EventHandler` instance for different event types, the caller needs to specify the event type from which the filter should be unregistered.

    Specified by:
      `removeEventFilter` in interface `EventTarget`
    Type Parameters:
      `E` - the event class of the filter
    Parameters:
      `eventType` - the event type from which to unregister
      `eventFilter` - the event filter

  - ### setOnShowing

    public final void setOnShowing(EventHandler<DialogEvent> value)
    Sets the value of the `onShowing` property.
    Property description:
      Called just prior to the Dialog being shown.
    Parameters:
      `value` - the value for the `onShowing` property
    See Also:
      - `getOnShowing()`
      - `onShowingProperty()`

  - ### getOnShowing

    public final EventHandler<DialogEvent> getOnShowing()
    Gets the value of the `onShowing` property.
    Property description:
      Called just prior to the Dialog being shown.
    Returns:
      the value of the `onShowing` property
    See Also:
      - `setOnShowing(EventHandler)`
      - `onShowingProperty()`

  - ### onShowingProperty

    public final ObjectProperty<EventHandler<DialogEvent>> onShowingProperty()
    Called just prior to the Dialog being shown.
    Returns:
      the `onShowing` property
    See Also:
      - `getOnShowing()`
      - `setOnShowing(EventHandler)`

  - ### setOnShown

    public final void setOnShown(EventHandler<DialogEvent> value)
    Sets the value of the `onShown` property.
    Property description:
      Called just after the Dialog is shown.
    Parameters:
      `value` - the value for the `onShown` property
    See Also:
      - `getOnShown()`
      - `onShownProperty()`

  - ### getOnShown

    public final EventHandler<DialogEvent> getOnShown()
    Gets the value of the `onShown` property.
    Property description:
      Called just after the Dialog is shown.
    Returns:
      the value of the `onShown` property
    See Also:
      - `setOnShown(EventHandler)`
      - `onShownProperty()`

  - ### onShownProperty

    public final ObjectProperty<EventHandler<DialogEvent>> onShownProperty()
    Called just after the Dialog is shown.
    Returns:
      the `onShown` property
    See Also:
      - `getOnShown()`
      - `setOnShown(EventHandler)`

  - ### setOnHiding

    public final void setOnHiding(EventHandler<DialogEvent> value)
    Sets the value of the `onHiding` property.
    Property description:
      Called just prior to the Dialog being hidden.
    Parameters:
      `value` - the value for the `onHiding` property
    See Also:
      - `getOnHiding()`
      - `onHidingProperty()`

  - ### getOnHiding

    public final EventHandler<DialogEvent> getOnHiding()
    Gets the value of the `onHiding` property.
    Property description:
      Called just prior to the Dialog being hidden.
    Returns:
      the value of the `onHiding` property
    See Also:
      - `setOnHiding(EventHandler)`
      - `onHidingProperty()`

  - ### onHidingProperty

    public final ObjectProperty<EventHandler<DialogEvent>> onHidingProperty()
    Called just prior to the Dialog being hidden.
    Returns:
      the `onHiding` property
    See Also:
      - `getOnHiding()`
      - `setOnHiding(EventHandler)`

  - ### setOnHidden

    public final void setOnHidden(EventHandler<DialogEvent> value)
    Sets the value of the `onHidden` property.
    Property description:
      Called just after the Dialog has been hidden. When the `Dialog` is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the `Alert` is closed.
    Parameters:
      `value` - the value for the `onHidden` property
    See Also:
      - `getOnHidden()`
      - `onHiddenProperty()`

  - ### getOnHidden

    public final EventHandler<DialogEvent> getOnHidden()
    Gets the value of the `onHidden` property.
    Property description:
      Called just after the Dialog has been hidden. When the `Dialog` is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the `Alert` is closed.
    Returns:
      the value of the `onHidden` property
    See Also:
      - `setOnHidden(EventHandler)`
      - `onHiddenProperty()`

  - ### onHiddenProperty

    public final ObjectProperty<EventHandler<DialogEvent>> onHiddenProperty()
    Called just after the Dialog has been hidden. When the `Dialog` is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the `Alert` is closed.
    Returns:
      the `onHidden` property
    See Also:
      - `getOnHidden()`
      - `setOnHidden(EventHandler)`

  - ### setOnCloseRequest

    public final void setOnCloseRequest(EventHandler<DialogEvent> value)
    Sets the value of the `onCloseRequest` property.
    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.
    Parameters:
      `value` - the value for the `onCloseRequest` property
    See Also:
      - `getOnCloseRequest()`
      - `onCloseRequestProperty()`

  - ### getOnCloseRequest

    public final EventHandler<DialogEvent> getOnCloseRequest()
    Gets the value of the `onCloseRequest` property.
    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.
    Returns:
      the value of the `onCloseRequest` property
    See Also:
      - `setOnCloseRequest(EventHandler)`
      - `onCloseRequestProperty()`

  - ### onCloseRequestProperty

    public final ObjectProperty<EventHandler<DialogEvent>> onCloseRequestProperty()
    Called when there is an external request to close this `Dialog`. The installed event handler can prevent dialog closing by consuming the received event.
    Returns:
      the `onCloseRequest` property
    See Also:
      - `getOnCloseRequest()`
      - `setOnCloseRequest(EventHandler)`