import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class TestStaticScene extends Application { // Root of scene graph static Group root = new Group(); // This must be run on the JavaFX application thread static Scene scene = new Scene(root, 400, 300); public static void main(String[] args) { Application.launch(args); } @Override public void start(final Stage stage) { System.err.println("scene = " + scene); Rectangle rect = new Rectangle(25, 40, 100, 50); root.getChildren().add(rect); stage.setScene(scene); stage.show(); } }