package jfxapp; import javafx.application.Application; import javafx.application.Platform; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.StageStyle; import javafx.stage.WindowEvent; public class mainApp extends Application { @Override public void start(Stage primaryStage) throws Exception{ setUserAgentStylesheet(Application.STYLESHEET_CASPIAN); Parent root = FXMLLoader.load(getClass().getResource("/rootForm.fxml")); primaryStage.setTitle("Aplikace JavaXF"); primaryStage.setScene(new Scene(root, 800, 600)); primaryStage.initStyle(StageStyle.UNIFIED); primaryStage.show(); primaryStage.setOnCloseRequest(new EventHandler() { @Override public void handle(WindowEvent event) { Platform.exit(); System.out.println("Aplikace byla řádně ukončena"); } }); } public static void main(String[] args) { launch(args); } }