package test.fxapp;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class MinimalShutdownCrashTest1 extends Application {

    @Override
    public void start(Stage stage) {
        Button closeButton = new Button("Close Application");
        closeButton.setOnAction(e -> Platform.exit());

        StackPane root = new StackPane(closeButton);
        Scene scene = new Scene(root, 300, 250);
        stage.setTitle("Shutdown Crash Test");
        stage.setScene(scene);
        stage.show();
    }

    @Override
    public void stop() {
        System.out.println("The stop method has been called. Terminating...");
    }

    public static void main(String[] args) {
        launch(args);
    }
}
