Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Alert

[15:7] extends: Dialog

Wraps JavaFX Alert, a pre-built dialog for displaying informational, warning, confirmation, or error messages with standard button responses. The alert type (INFORMATION, WARNING, CONFIRMATION, ERROR, or NONE) controls the icon and default buttons shown. Optional title, header, and content text can be set before displaying. Call showAndWait() to block until the user responds, or show() to display the dialog without blocking.

Methods

  • Alert (string AlertType = "INFORMATION", string Text = "")

    Creates a new Alert with the specified type and optional content text.

    • @p AlertType is a string: INFORMATION, WARNING, CONFIRMATION, ERROR, or NONE.
    • @p Text is an optional string with content text.
  • addButton (string ButtonType)

    Adds a custom button to the alert dialog.

    • @p ButtonType is a string matching a ButtonType constant name, e.g., OK or CANCEL.
    • @r this object for chaining
  • alertTypeProperty ()

    Returns the property that holds this alert's AlertType. Bind or attach listeners to react when the alert type changes.

    • @r An ObjectProperty AJO holding the Alert$AlertType.
  • getAlertType ()

    Returns the current AlertType for this alert.

    • @r An AJO holding the Alert$AlertType enum value.
  • getButtonTypes ()

    Returns the live ObservableList of ButtonType values shown by this alert. Mutations to the returned list are reflected on the dialog.

    • @r An ObservableList AJO of ButtonType elements.
  • setAlertType (string AlertType)

    Sets the AlertType for this alert.

    • @p AlertType is a string: INFORMATION, WARNING, CONFIRMATION, ERROR, or NONE.
    • @r this object for chaining