使用jdk 8时,Java Modal对话框会冻结整个应用程序

时间:2018-02-08 02:00:22

标签: java swing modal-dialog freeze

很少,当使用JDK1.8.0_144在Java Swing应用程序中显示模式对话框时,整个应用程序将被冻结。

我在JDK错误数据库中找不到相关的错误。唯一一个与远程相关的问题是this one,但是我们的应用程序在被冻结时从未被最小化。

我在调试中发现了一次,似乎事件仍然由次循环处理(焦点事件,鼠标移动事件),但模式对话框无法关闭,用户无法与应用程序交互。

显然我的第一个想法是更新JDK版本,但由于我很少能重现这个问题,我不确定它是否能解决问题。

任何人都有这种情况发生在他们身上,或者您对如何调试或修复有任何建议?

 WARN[09:41:41,482] - SwingCheckerTimer - stacktrace - AWT-EventQueue-0, Id = 22, Priority = 6: WAITING
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.awt.EventQueue.getNextEvent(EventQueue.java:608)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:170)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.SequencedEvent.dispatch(SequencedEvent.java:107)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.awt.EventQueue$4.run(EventQueue.java:729)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
java.security.AccessController.doPrivileged(Native Method)
java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
java.awt.Dialog.show(Dialog.java:1084)
java.awt.Component.show(Component.java:1671)
java.awt.Component.setVisible(Component.java:1623)
java.awt.Window.setVisible(Window.java:1014)
java.awt.Dialog.setVisible(Dialog.java:1005)

0 个答案:

没有答案