I don’t know Scala, but it’s easy to read the example code and understand what it does. A lot of it reminds me of how well JavaFX integrates with Kotlin.
The configuration code reads very similar to how Kotlin uses
apply{}
to do the same things.What I wonder, though, is how much you actually need ScalaFX to do this? Does it fall into the same category as TornadoFX does with Kotlin?
For instance, in the example code it uses some sort of extension of
Application
which looks like it makes the Stage setup more declarative. But, presumably you could use the standardstart()
routine and use the same kind of syntax to configureprimaryStage
. So how much value does the customApplication
actually add?ScalaFX is so good at what it does (offering a declarative and concise way to build UIs with events handling and animations) that I would go as far as to recommend it in place of FXML, and beyond just Scala projects. It’s that good (IMO)
Recommending it in place of FXML is not a very high bar, IMHO. 🙂