-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
6u24
-
x86
-
solaris_8
FULL PRODUCT VERSION :
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
A simple Swing application started using JNLP hangs when the main window is closed by clicking the standard red cross icon. The mouse cursor is captured and no other application can be activated with the mouse. Keyboard response to switch focus e.g. ALT-TAB works as expected.
Sometimes the application close after 10s or so but if you click with the mouse the application occassionaly enters a semi-permanent hung state.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Click the run FrameDemo link at the following URL http://download.oracle.com/javase/tutorial/uiswing/components/frame.html. Click the applications red cross close icon.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application window should close immediately.
ACTUAL -
The application hangs for at least several seconds with the mouse unresponsive.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
======= FrameDemo class ===================
package components;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/* FrameDemo.java requires no other files. */
public class FrameDemo {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
============ JNLP launch file ===============
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for FrameDemo -->
<jnlp
spec="1.0+"
codebase="http://download.oracle.com/docs/cd/E17746_01/tutorialJWS/uiswing/components/ex6"
href="FrameDemo.jnlp">
<information>
<title>FrameDemo</title>
<vendor>The Java(tm) Tutorial</vendor>
<homepage href="http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/examples/components/index.html#FrameDemo"/>
<description>FrameDemo</description>
<description kind="short">Demonstrates use of buttons within containers</description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+"/>
<jar href="FrameDemo.jar"/>
</resources>
<application-desc main-class="components.FrameDemo"/>
</jnlp>
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding a WindowListener with a call to System.exit(0) in the close method forces the window to close.
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
A simple Swing application started using JNLP hangs when the main window is closed by clicking the standard red cross icon. The mouse cursor is captured and no other application can be activated with the mouse. Keyboard response to switch focus e.g. ALT-TAB works as expected.
Sometimes the application close after 10s or so but if you click with the mouse the application occassionaly enters a semi-permanent hung state.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Click the run FrameDemo link at the following URL http://download.oracle.com/javase/tutorial/uiswing/components/frame.html. Click the applications red cross close icon.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application window should close immediately.
ACTUAL -
The application hangs for at least several seconds with the mouse unresponsive.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
======= FrameDemo class ===================
package components;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/* FrameDemo.java requires no other files. */
public class FrameDemo {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
============ JNLP launch file ===============
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for FrameDemo -->
<jnlp
spec="1.0+"
codebase="http://download.oracle.com/docs/cd/E17746_01/tutorialJWS/uiswing/components/ex6"
href="FrameDemo.jnlp">
<information>
<title>FrameDemo</title>
<vendor>The Java(tm) Tutorial</vendor>
<homepage href="http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/examples/components/index.html#FrameDemo"/>
<description>FrameDemo</description>
<description kind="short">Demonstrates use of buttons within containers</description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+"/>
<jar href="FrameDemo.jar"/>
</resources>
<application-desc main-class="components.FrameDemo"/>
</jnlp>
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding a WindowListener with a call to System.exit(0) in the close method forces the window to close.