Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8359763

Close request handler is not called for an extended stage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx26
    • jfx25
    • javafx

        Reproducer:

        Button button = new Button("Click");
        button.setOnAction(e -> {
        final Dialog<Object> dialog = new Dialog<>();
        dialog.initOwner(primaryStage);
        // dialog.initStyle(StageStyle.EXTENDED); // uncomment for bug
        dialog.initModality(Modality.NONE);
        dialog.setResizable(true); // This is important
        dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
        dialog.setOnCloseRequest(dialogEvent -> {
        System.out.println("Close the dialog pane. This is not called when EXTENDED is used.");
        });
        dialog.show();
        });

        StackPane root = new StackPane(button);
        Scene scene = new Scene(root, 300, 200);
        primaryStage.setScene(scene);
        primaryStage.show();

              mstrauss Michael Strauß
              mstrauss Michael Strauß
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: