Skip to content

Ktfx Commons – Dialogs

Hendra Anggrian edited this page Nov 21, 2019 · 2 revisions

Alerts & dialogs

Displaying alert is easier than ever with a one-liner.

alert("Hi")

infoAlert("Some information")

warningAlert("You have been warned", myImage)

confirmAlert("Are you sure?", content = "You have to be completely sure.")

errorAlert("Some scary message", ButtonType.HELP)

Choosing files & directories

Pick files and directories like dialogs.

val file = window.chooseFile("Any file")
val files = window.chooseFiles(ExtensionFilter("Portable File Document", "*.pdf"))
val saveFile = window.chooseSaveFile("File to save")

val directory = window.chooseDirectory("Choose folder")