JDK-4017797 : there's no way to write a blocking dialog that's not modal
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.0.2
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_2.5
  • CPU: generic
  • Submitted: 1996-12-04
  • Updated: 2000-01-08
  • Resolved: 2000-01-08
Related Reports
Relates :  
Description
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.

Comments
WORK AROUND Use a modal dialog since it will not block *all* applets now.
11-06-2004

EVALUATION Potential fix for 1.2. lara.bunni@Eng 1997-11-25 This is a 1.0 RFE. I'm fairly sure this is no longer the case, with each Applet getting its own AppContext. I would go with Not a Bug, pending other opinions. richard.ray@eng 2000-01-06 Will review in the next AWT meeting. richard.ray@eng 2000-01-06 Per Bill Shannon.. You might then reasonably decide that there is not sufficient motivation for this RFE (simply use modal dialogs if you want the call to show to block) richard.ray@eng 2000-01-07
07-01-2000