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

[Dialogs] Alert Dialog restores itself after you minimize it

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P3
    • 8u40
    • 8u40
    • javafx
    • None
    • Ubuntu 14.04.

    Description

      Run the following test code:

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.scene.Scene;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class TestAlert extends Application {
          
          @Override
          public void start(Stage primaryStage) {
              Button btn = new Button();
              btn.setText("Show Alert !!");
              btn.setOnAction((ActionEvent event) -> {
                  Alert alert = new Alert(Alert.AlertType.INFORMATION);
                  alert.getDialogPane().setContentText("Cannot Minimise this alert :-(");
                  alert.show();
              });
              
              StackPane root = new StackPane();
              root.getChildren().add(btn);
              
              Scene scene = new Scene(root, 300, 250);
              
              primaryStage.setTitle("Hello Alert!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

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

      1) Click on the button. It will open an Alert. When you click on the minimize button of the Alert it will minimize but after that the Alert automatically maximizes by itself. Hence the Alert cannot be kept minimised.

      2) But after showing the Alert if you minimize the primaryStage and then try to minimize the Alert, it will stay minimised. So no issues there.

      Attachments

        Issue Links

          Activity

            People

              ddhill David Hill (Inactive)
              asarkar Anirvan Sarkar
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: