United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4688142 : REGRESSION: case where opening a modal dialog will hang the application.

Details
Type:
Bug
Submit Date:
2002-05-20
Status:
Resolved
Updated Date:
2002-08-22
Project Name:
JDK
Resolved Date:
2002-08-22
Component:
client-libs
OS:
windows_2000
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.2 (mantis)

Related Reports
Relates:

Sub Tasks

Description

Name: gm110360			Date: 05/20/2002


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
ServicePack 2

A DESCRIPTION OF THE PROBLEM :
This bug is very closely related to bug #4636311 but is a
more generic way of recreating the problem.  Basicaly, I
have found a way to consistantly hang the application just
by opening a modal dialog a specific time.  In my test
program that I provided, I am opening a modal dialog from
the windowActivated(...) event of a window listener of a
JFrame.  This will effectively open the dialog right after
the frame becomes visible.  This will hang the VM every
time.  This bug is EXTREMELY detrimental to our
application, as there are several places where we open
dialogs at various times as windows are opened, or as they
are activated to do auto-processing and such.  This problem
makes those features completely unusable.  I have seen
proposed work-arounds that involve pushing the open to a
SwingUtilities.invokeLater(...), but this really isn't a
viable option as it would involve massive restructuring of
evey place this could possibly get hit in order to allow
the setVisible(true) to be pushed into a runnable that can
be invoked later and still maintain the fact that it needs
to be modal.  Please give us some resolution to this issue.

REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Run the sample code.
2.When the frame and the dialog appear, the app. will be
locked.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Both the frame and the dialog should open without issue.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Example
{
    public static void main(String [] args)
    {
        final JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        f.getContentPane().add(new JLabel("Parent Frame"));
        f.addWindowListener(new WindowAdapter(){
            public void windowActivated(WindowEvent e)
            {
                JDialog d = new JDialog(f, "Modal Dialg", true);
                d.getContentPane().add(new JLabel("Child Dialog"));
                d.pack();
                d.setVisible(true);
            }
        });
        f.pack();
        f.setVisible(true);
    }
}
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
None known.
(Review ID: 146807) 
======================================================================

                                    

Comments
EVALUATION

Commit to fix in mantis.  
###@###.### 2002-05-23


Name: osR10079			Date: 08/02/2002

The problem is the same as 4531693
======================================================================
                                     
2002-05-23
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis


                                     
2004-08-24



Hardware and Software, Engineered to Work Together