package org.openjfx.gradle.javafx.test; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) { StackPane root = new StackPane(new Label("Hello World!")); Scene scene = new Scene(root, 800, 600); primaryStage.setScene(scene); primaryStage.show(); new Thread(() -> { try { Thread.sleep(500); } catch (InterruptedException e) { throw new RuntimeException("Should not happen!"); } System.exit(0); }).start(); } }