Skip to content

ScalaFX-Extras v.0.6.0

Compare
Choose a tag to compare
@jpsacha jpsacha released this 14 Jul 12:24
· 87 commits to master since this release
v.0.6.0
a82929d

This release add a new class for convenient creation of input dialogs: GenericDialogFX. You can easily add controls to
he dialog then read their values after the dialog was closed:

// Create a dialog
val dialog =
  new GenericDialogFX(
    title = "GenericDialogFX Demo",
    header = "Fancy description can go here."
  ) {
    // Add fields
    addCheckbox("Check me out!", defaultValue = false)
    addCheckbox("Check me too!", defaultValue = true)
  }

// Show dialog to the user
dialog.showDialog()

// Read input provided by the user
if (dialog.wasOKed) {
  val select1 = dialog.nextBoolean()
  val select2 = dialog.nextBoolean()

  println(s"Selection 1: $select1")
  println(s"Selection 2: $select2")
} else {
  println("Dialog was cancelled.")
}

The scalafx-extras-demos subproject has a more elaborated example.

Enhancements:

  • Support creation of custom dialogs, like ImageJ's GenericDialog #16
  • Let any standard dialog be displayed with a one-liner #17

To post questions please use Project Discussions or ScalaFX Users Group

Full Changelog: v.0.5.0...v.0.6.0