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

[Mac] App does not quit with cmd + Q, when having a FileChooser or DirectoryChooser open

XMLWordPrintable

      In MacOS, run the Sample App below. Press the button, and once the FileChooser is open quit the application with cmd+Q.

      Expected result: App quits correctly
      Actual Result: Can not see the UI of the app, but it is still on the Activity Monitor. When running from eclipse we can still see in the Debug view the Threads:

      Deamon Thread [Disposer] (Running)
      Deamon Thread [Thread-2] (Running)
      Thread [JavaFX Application Thread] (Running)
       Thread [DestroyJavaVM] (Running)

      ------------------------------------HelloWorld.java-------------------
      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.stage.FileChooser;
      import javafx.stage.Stage;

      public class HelloWorld extends Application {
         public static void main(String[] args) {
             launch(args);
         }
         
         @Override
         public void start(final Stage primaryStage) {

             Button btn = new Button();
             btn.setOnAction(new EventHandler<ActionEvent>() {

                 @Override
                 public void handle(ActionEvent event) {
      FileChooser fc = new FileChooser();
      fc.showOpenMultipleDialog(primaryStage);
                 }
             });
             
             StackPane root = new StackPane();
             root.getChildren().add(btn);
             primaryStage.setScene(new Scene(root, 300, 250));
             primaryStage.show();
         }
      }

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: