Dialog

open class Dialog : WithContent

A quick and easy way to create dialogs, with a button bar.

Example :

dialog {
    title = "Hello"
    content {
        Label("Hello World")
    }
    buttons(ButtonType.OK, ButtonType.CANCEL) { reply ->
        if (reply == ButtonType.OK) println("OK Pressed")
    }
}.show(parentStage)

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
override var content: Node?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

An event handler for when this button is pressed.

Link copied to clipboard
Link copied to clipboard

The ButtonType that was pressed to dismiss this Dialog.

Link copied to clipboard
lateinit var stage: Stage

A lateinit var, which is set in createStage. Accessing it before createStage is called will throw an Exception.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun buttons(block: ButtonBar.() -> Unit)
Link copied to clipboard
fun buttonTypes(vararg buttonTypes: ButtonType, handler: (ButtonType) -> Unit? = null)

Adds buttons to the buttonBar. All these buttons close the popup stage before the handler is called.

Link copied to clipboard
fun createStage(parentStage: Stage, stageType: StageType = StageType.NORMAL, block: Stage.() -> Unit? = null): Stage
Link copied to clipboard
fun onCreate(handlerCombination: HandlerCombination = HandlerCombination.AFTER, block: (event: ActionEvent) -> Unit)

A convenient way to set onCreateProperty using a lambda. However, if an event handler is already present, then BOTH will be used.