Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TextInputDialog

[12:7] extends: FxObj

Wraps JavaFX TextInputDialog, a dialog that prompts the user to enter a string and returns the entered text. An optional default value pre-fills the input field 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 entered text.

Methods

  • TextInputDialog (string DefaultValue = "")

    Creates a new TextInputDialog with an optional default value.

    • @p DefaultValue is a string with the initial text.
  • 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.