-
Bug
-
Resolution: Fixed
-
P2
-
8u131, 9
-
b172
-
x86_64
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8181560 | 10 | Semyon Sadetsky | P2 | Resolved | Fixed | b11 |
JDK-8181279 | 9.0.4 | Semyon Sadetsky | P2 | Resolved | Fixed | b01 |
JDK-8201690 | 8u192 | Alexey Ivanov | P2 | Resolved | Fixed | b01 |
JDK-8196277 | 8u191 | Alexey Ivanov | P2 | Resolved | Fixed | b01 |
JDK-8201109 | 8u181 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8192999 | 8u172 | Alexey Ivanov | P2 | Closed | Fixed | b01 |
JDK-8194112 | 8u171 | Alexey Ivanov | P2 | Closed | Fixed | b01 |
JDK-8194305 | 8u162 | Alexey Ivanov | P2 | Resolved | Fixed | b31 |
JDK-8193383 | 8u152 | Alexey Ivanov | P2 | Closed | Fixed | b34 |
JDK-8203126 | emb-8u181 | Alexey Ivanov | P2 | Resolved | Fixed | master |
JDK-8198179 | emb-8u171 | Alexey Ivanov | P2 | Resolved | Fixed | b01 |
JDK-8203749 | openjdk7u | Alexey Ivanov | P2 | Resolved | Fixed | master |
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
If a modal dialog is made visible after its parent frame is set to always-on-top, closed by hitting the "Enter" key which activates a default button, then the parent frame is set to not-always-on-top, an IllegalComponentStateException is raised.
The stack dump looks the same as in http://bugs.java.com/view_bug.do?bug_id=8159242, though the description of that bug doesn't seem to have anything to do with the stack dump.
There is good reason to set the dialog's frame parent to always-on-top while it is up, if the dialog itself is always-on-top. If another modal dialog pops up while it is up, that other dialog may otherwise be hidden, and the application will appear to be locked up. There are also good reasons to make all modal dialogs always-on-top.
REGRESSION. Last worked in version 8u121
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run code, hit "Enter" to close the dialog.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect no exceptions.
ACTUAL -
An IllegalComponentStateException occurs.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2062)
at java.awt.Component.getLocationOnScreen(Component.java:2036)
at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(JTextComponent.java:4643)
at sun.awt.im.InputMethodContext.getTextLocation(InputMethodContext.java:278)
at sun.awt.windows.WInputMethod$1.run(WInputMethod.java:588)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ICSEBug {
public static void main(String[] args) {
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
go();
}
});
}
static void go() {
JFrame f = new JFrame();
f.setVisible(true);
final JDialog d = new JDialog(f);
d.getContentPane().add(new JTextField(20), "Center");
JButton closeButton = new JButton("Close");
closeButton.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
d.setVisible(false);
}
});
d.getContentPane().add(closeButton, "South");
d.getRootPane().setDefaultButton(closeButton);
d.setModal(true);
d.setSize(300, 300);
f.setAlwaysOnTop(true);
d.setVisible(true);
f.setAlwaysOnTop(false);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
If the exception is caught in a global uncaught exception handler, it can be ignored. It doesn't seem to cause any problems.
- backported by
-
JDK-8181279 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8181560 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8194305 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8196277 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8198179 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8201109 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8201690 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8203126 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8203749 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Resolved
-
JDK-8192999 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Closed
-
JDK-8193383 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Closed
-
JDK-8194112 [Windows] java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
- Closed
- duplicates
-
JDK-8186432 runtime error java.awt.IllegalComponentStateException thrown from multiple locations in application
- Closed
-
JDK-8198809 IllegalComponentStateException if Window did not have focus before clicking
- Closed
- relates to
-
JDK-8147842 IME Composition Window is displayed at incorrect location
- Resolved
-
JDK-8186432 runtime error java.awt.IllegalComponentStateException thrown from multiple locations in application
- Closed