ScalaFX 16.0.0-R25 supports JavaFX 16. This release was tested to work with Java 11 and Java 16. It can be used with Scala 2.12, 2.13, and Scala 3.

The main new feature of this release is the simpler way to crate custom cellFactory (Issue #256). The JavaFX boilerplate code generation was moved behind the scenes. A correct cellFactory can be defined with a simple lambda. For instance, here we render a cell content as a Circle of a given color:

cellFactory = (cell, color) => {
  cell.graphic = Circle(fill = color, radius = 8)
}

Compare to the more verbose way that had to be done in previous versions to endure that empty cells are rendered correctly:

cellFactory = { _ =>
  new TableCell[Person, Color] {
    item.onChange { (_, _, newColor) =>
      graphic =
        if (newColor != null)
          new Circle {
            fill = newColor
            radius = 8
          }
        else
          null
    }
  }
}

You can find a brief description here. There are several examples of how to use cellFactory use with different controls in scalafx-demos.

Note that if you use the old way of assigning cellFactory you will need to be more explicit and provide type annotations for lambda arguments. Without that some old code may not compile with 16.0.0-R25.

New Features

  • Issue #256 - Change custom cellFactory assignment methods to help in correct implementation that avoids artifacts

Bug fixes:

  • Issue #360 - Implicit should convert jfxa.Application.Parameters to JFXApp3.Parameters

Updates to documentation and demos:

  • Issue #352 - Update scaladoc demos to use JFXApp3. Big thanks to @rom1dep for converting the demos.
  • Issue #353 - Update scalafx.org documentation to use JFXApp3 instead of deprecated JFXApp.

For downloads visit ScalaFX on Sonatype or ScalaFX Releases on GitHub. If you have ScalaFX related questions please use ScalaFX Discussions, or ScalaFX Users Group, or ScalaFX on StackOverflow. Please report any problems using ScalaFX Issue Tracker.