Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ChoiceDialog

[12:7] extends: FxObj

Wraps JavaFX ChoiceDialog, a dialog that lets the user select one item from a list of choices and returns the selected item. A default choice is shown pre-selected when the dialog opens. Title, header text, and content text can be set to provide context. Call showAndWait() to block until the user confirms or cancels, then inspect the returned value for the chosen item.

Methods

  • ChoiceDialog (DefaultChoice, list Choices)

    Creates a new ChoiceDialog with a default choice and a list of options.

    • @p DefaultChoice is the initially selected value.
    • @p Choices is a list of choice values.
  • setTitle (string Title)

    Sets the dialog title.

    • @p Title is a string with the title.
    • @r this object for chaining
  • setHeaderText (string Text)

    Sets the header text.

    • @p Text is a string with the header.
    • @r this object for chaining
  • setContentText (string Text)

    Sets the content text.

    • @p Text is a string with the content.
    • @r this object for chaining
  • showAndWait ()

    Shows the dialog and waits for the user to close it.

    • @r The result of the dialog.