I want to use this code to display generic Javafx Scene from my program
class JFXWindowDisplay(myScene:Scene) extends Application {
def start( stage: Stage) {
stage.setTitle("My JavaFX Application")
stage.setScene(myScene)
stage.show()
}
}
//OBJECT NEEDED TO RUN JAVAFX : http://stackoverflow.com/questions/12124657/getting-started-on-scala-javafx-desktop-application-development
object JFXWindowDisplay extends App {
override def main(args: Array[String]) {
Application.launch(classOf[JFXWindowDisplay], args: _*)
}
}
How can i pass Scene argument to the compagnon object ?
For example, i want to create a program which open a new javafx windows from scala script execution of this :
class myProgram() extends App {
val root = new StackPane
root.getChildren.add(new Label("Hello world!"))
val myScene = new Scene(root, 300, 300))
// then run ControlTest object with this scene
ControlTest(myScene)
}