AWT-EventQueue 线程和 AWT-Shutdown 线程未关闭 [英] AWT-EventQueue thread and AWT-Shutdown thread not shutting down
本文介绍了AWT-EventQueue 线程和 AWT-Shutdown 线程未关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们的应用程序中的 AWT-EventQueue 线程和 AWT-Shutdown 线程没有关闭.是否有一种调试技术可以找出它们为什么不是?有什么特别要注意的吗?
The AWT-EventQueue thread and AWT-Shutdown thread are not shutting down in our application. Is there a debugging technique for finding out why they are not? Any special things to look for?
推荐答案
如果你的意思是关闭所有窗口后JVM没有正常退出,那么看以下几点:
If you mean that the JVM doesn't exit properly after closing all windows, then look at the following points:
- 检查所有窗口是否已正确处理,而不仅仅是简单地隐藏起来;其中包括由 Swing(或 AWT)作为无所有者对话框的所有者创建的不可见窗口.为此,您可以检查
Window.getWindows()
- 确保在处理完所有窗口后没有活动的
Thread
(守护进程除外) - 确保您的应用程序不是由 Java Web Start 启动的,因为在这种情况下您必须调用
System.exit(0)
(这是 JWS 的已知错误)
- check that ALL windows have been disposed properly, not just simply made invisible; that includes the invisible window created by Swing (or AWT) as the owner of ownerless dialogs. For this you can check
Window.getWindows()
- make sure you have no active
Thread
(except daemons) after disposing of all windows - ensure that your application was not launched by Java Web Start, because in this case you must call
System.exit(0)
(that's a known bug of JWS)
希望这有助于回答您的问题.
Hope this helps answer your question.
此外,最近还有这个SO问题关于垃圾收集摆动窗户.
Besides, there was also this SO question recently about garbage collection of Swing windows.
这篇关于AWT-EventQueue 线程和 AWT-Shutdown 线程未关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文