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

there's no way to write a blocking dialog that's not modal

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.0.2
    • client-libs
    • None
    • generic
    • solaris_2.5

      I need to use a dialog to gather input from the user as a part of
      implementing an API. The API should only return when the operation
      has completed, but the user input is needed to complete the operation.
      Creating a modal dialog to collect input from the user works, but
      blocks *all* other applets. This is unacceptable when the applet is part
      of HotJava Views - the user might want to switch to another applet, or
      even to interact with the current applet in other ways that don't require
      the requested input.

      What I need is a way to write a dialog that allows the creator of the dialog
      to block until the dialog completes, but without being modal. If the thread
      that creates the dialog blocks, AWT event dispatching comes to a halt.

      After talking to Amy, we came up with the following possibilities:

      1. Allow code that's run in the event dispatching thread to block arbitrarily,
         and create a mechanism for AWT to be notified that the event dispatching
         thread has blocked (or is about to block) so that it can create another
         event dispatching thread. This would be similar to SIGLWP in Solaris.

      2. Add a new option to dialogs to allow them to be blocking but not modal.
         This is easily implemented given the current 1.1 structure but only
         solves the problem for blocking dialogs (what I need, but not a general
         solution).

      3. Expose the EventDispatchThread so that users can create another one manually
         before blocking the current event dispatching thread.

      Any of these would be a major step forward. #1 is the best general solution.
      #2 is a quick easy fix. #3 is a general but ugly solution.

            rraysunw Richard Ray (Inactive)
            bshannon Bill Shannon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: