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

FileDialog with null parent does not block a toolkit modal dialog

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • client-libs
    • None

      Accordingly to spec. for FileDialog - http://docs.oracle.com/javase/8/docs/api/java/awt/FileDialog.html
      "since it is a modal dialog, when the application calls its show method to display the dialog, it blocks the rest of the application until the user has chosen a file."

      Please run the attached test and push 'Open' button. A file dialog will appear. Try to push 'Close' button on the parent dialog - you cannot do that because it is blocked.
      Close the tests.

      Then change parent of fd to null:
      FileDialog fd = new FileDialog((Dialog) null);
      - now you can close the parent dialog before the FileDialog - that seems to be a bug; and application is still running even after closing both of the dialogs.

      If change 'TOOLKIT_MODAL' to any other modality type then the parent dialog should be blocked again.

      Checked with JDK9-b14 on Ubuntu 14.04 Linux and Windows 7.

            Unassigned Unassigned
            avstepan Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: