javafx

A sample Scala/JavaFX application

As a brief note to self, here’s an example JavaFX application written in Scala:

object MainWindow {
    def main(args: Array[String]) {
        Application.launch(classOf[MainWindow], args: _*)
    }
}

class MainWindow extends Application  {
    override def start(stage: Stage) {
        val borderPane = new MainBorderPane
        val scene = new Scene(borderPane, 600, 400)
        scene.getStylesheets.add(getClass.getResource("pizza.css").toExternalForm)
        stage.setScene(scene)
        stage.setTitle("Al’s Pizza")
        stage.show
    }
}

JavaFX is going to be removed from the Java JDK

Just read that JavaFX is going to be removed from the Java JDK. From the article: “Making JavaFX its own module will make it easier to adopt and clear the way for new contributors, Oracle said. The company added that with the faster release schedule being implemented for standard Java and the JDK, JavaFX needs to be on its own pace driven by contributions from Oracle and others in the OpenJFX community.”