For the impatient, here’s how to get started using ScalaFX in your development.
If you are reading this Quick-start Guide you are probably already know how to use Scala in your project and probably have your favorite IDE or build setup to program in Scala. If not, details will be explained later.
ScalaFX supports JavaFX 2.2 and JavaFX 8.
To create a ScalaFX application you only need to add dependency on ScalaFX library.
For JavaFX 2.2 (distributed with Java 7) you will need to add dependency on ScalaFX v.1.
For JavaFX 8 (distributed with Java 8) you will need to add dependency on ScalaFX v.8.
For instance, if you are using Java8 and SBT as your build system, add the following line to
You can download ScalaFX releases from Maven repository at Sonatype.
Now you are ready to type-in and run you first ScalaFX application:
It will display window like this:
You can find complete project in the scalafx-hello-world sample at GitHub. You can clone the repo or download sample code from the Release page. The project can be run from command line or loaded into IntelliJ IDEA, NetBeans, or Eclipse.