JDK-4615188 : Modal Dialog Blocking A Certain Window
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.2_009
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86
  • Submitted: 2001-12-18
  • Updated: 2001-12-21
  • Resolved: 2001-12-18
Related Reports
Duplicate :  
Relates :  
Description
Harsha Godugu asked me to raise this escalation.

We have the following problem concerning modal dialogs:
In our telephony client application we have a window for the configuration of the settings. So there is our client in one window and the settings in another. In case of invalid user input or warnings we have to show dialogs on the settings window. This dialogs must block the settings window but not the window of the telephony client. If the client would also be blocked the user could not accept phone calls during the time the settings window was displaying a dialog.

So what we are looking for is a modal dialog which is blocking only a certain window but the other window(s) are not concerned. We were trying to get a solution by using threads but were not successful in the end.

-------
The suggestion to use disable() respectively setEnabled(false) is not new
for us. We tried this already.

There are two problems with it:

1) Our settings frame contains quite a lot of swing elements so disabling
and enabling it causes it to flicker quite much...
(You can't see this effect in your example as it doesn't contain much.)

2) We need a dialog behaving like a modal dialog concernig the returning of
the show() method so the show() method returns when the dialog is closed.
(Using window listeners is not possible, as we need the data entered in the
dialog respectively the answer which button was pressed immedialtly after
showing the dialog.)



DESCRIPTIONEND
TESTCASEBEGIN
Finally I created a example to show the flickering.
I couldn't give you our source code because you would need to make a
complete installation.

You can choose to show a Modal Dialog (--> modal JDialog) or a Semi Modal
Dialog (--> non-modal JDialog using setEnabled() for blocking certain
window).
 
<> You'll see that showing the Modal Dialog doesn't flicker at all while
showing the Semi Modal Dialog does.
The bigger the Semi Modal Dialog is (in size and I think also in the number
of components it contains) the worse the visual effect gets.
Our real SettingsFrame contains quite a lot of components which effects in
quite a lot of "flickering"

-----

Originally the problem was to have a Modal Dialog  specific to a particular window in an Application with Multiple windows. This can be achieved by using 
the java.awt api setEnabled (boolean t) . This is  the work around to the initial problem. This work around causes large amount of flickering which is not 
acceptable to Customer. The flickering is caused by the side effect of the fix for Bug # 4038881. This happens on windows.  


Action(s): 
Sustaining:
  - To investigate the fix & the side effects of the fix for bug 4038881.

Could not set the "Release" should be Java 1.2.2_x, 1.3.x

Comments
WORK AROUND Got this back from engineering. Tried it here, but it did not work can you try it out. In the test case attached: Please reverse the order of the lines in SemiModalDialog.java : hide() as follows: { ... // un-block the owner frame getOwner().setEnabled(true); super.hide(); ... }
11-06-2004

SUGGESTED FIX From Harsha Godugu (Sun) Thanks for the details provided. I found this problem, as a side effect of a fix for another bug on windows. Would you please use the attached awt.dll and let me know if the problem is resolved. You need to replace Java_home/bin/awt.dll with the dll attached in this email. This dll works fine with jdk 1.3.1_01 only. So, please use jdk1.3.1_01. If the problem is gone, I can provide 1.2.2_09 dll for testing purpose. You still need to reverse the lines of code in the test case, as I mentioned in my previous email. Means, first enable the window and then hide the dialog. Customer phoned to confirm the fix was OK. He may upgrade to use a newer JDK, so has asked JPSE what versions of the JDK the fix will be in.
11-06-2004

EVALUATION This is a duplicate of 4080029 ###@###.### 2001-12-18
18-12-2001