JDK-6417395 : New IE applet window becomes unresponsive if it is launched after the modal dialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-04-25
  • Updated: 2014-02-27
  • Resolved: 2006-08-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0u10 b01Fixed
Related Reports
Relates :  
Relates :  
Description
Steps to reproduce the applet unresponsiveness:

a. Run the applet below 
b. press "call dialog" button. This creates a modal dialog and a new browser window. 
c. click "OK" in the dialog. The dialog goes away
d. Try to press a button in the "NEW browser window" which was created in step "b"

Result: The button can not be pressed. The applet is frozen.

Reproducible with the latest 5.0u7 build. This doesn't happen on 1.4.2

TC05-01_Top.html
----------------
<APPLET CODE="SampleApplet.class" WIDTH=300 HEIGHT=220>
  <PARAM NAME="PAGE" VALUE="TC05-01_Top.html">
</APPLET>

SampleApplet.java
-----------------
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.net.URL;

public class SampleApplet extends JApplet{
    private JButton jButton1 = new JButton();

    public SampleApplet() {
    }

    public void init() {
        try {
            jbInit();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        jButton1.setBounds(new Rectangle(56, 98, 135, 38));
        jButton1.setText("Call Dialog");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                jButton1_actionPerformed(e);
            }
        });
        this.getContentPane().setLayout(null);
        this.setSize(new Dimension(400,300));
        this.getContentPane().add(jButton1, null);
    }

    public void start() {
    }

    public void stop() {
    }

    public void destroy() {
    }

    void jButton1_actionPerformed(ActionEvent e) {
        String strOption[] = new String[2];
        strOption[0] = "OK";
        strOption[1] = "Cancel";
		(new ThreadX(this)).start();        
       	
        JOptionPane.showOptionDialog(this, "Hello", "Hello", JOptionPane.DEFAULT_OPTION, 
JOptionPane.PLAIN_MESSAGE, null, strOption, strOption[0]);
    }

    class ThreadX extends Thread{
  
        SampleApplet jap = null;

        ThreadX(SampleApplet jap){
			this.jap = jap;
 		}

  		public void run(){
	        try {
            	Thread.sleep(1000);

   		        this.jap.getAppletContext().showDocument(new URL(this.jap.getCodeBase()+this.jap.getParameter("PAGE")), "_blank");
	        }
   		    catch (Exception ex) {
       		    ex.printStackTrace();
        	}
		}
	}
}

Comments
SUGGESTED FIX ------- awt_Frame.cpp ------- *** /tmp/sccs.2iaWW4 Fri May 12 23:27:01 2006 --- awt_Frame.cpp Thu May 11 14:06:51 2006 *************** *** 489,495 **** moveToDefaultLocation(); } ! if (!AwtDialog::IsModalExcluded(hwnd)) { AwtDialog::SetDisabledLevelToGreatest(this); } --- 489,495 ---- moveToDefaultLocation(); } ! if (!AwtDialog::IsModalExcluded(hwnd) && !m_isEmbedded) {
13-05-2006

EVALUATION most likely the problem is in AwtFrame::Show() method (awt_Frame.cpp) if (!AwtDialog::IsModalExcluded(hwnd)) { AwtDialog::SetDisabledLevelToGreatest(this); } we disable the frame which we show if there is a shown modal dialog. It is supposed that this property will be removed after hiding the dialog. We do this by iterating oll toplevel windows and removing this property. But embedded frame is not a toplevel from Windows point of view, so we do not enable it. To think this we shouldn't call AwtDialog::SetDisabledLevelToGreatest() for embedded frame. Hope we will filter out all unnecessary events in java :)
12-05-2006

EVALUATION Based on the discussion with ###@###.### and ###@###.### this is an AWT issue.
12-05-2006