Normally a swing application exits gracefully if all of its swing windows have been disposed of, for example, this program will pop a window then exit once it is closed (all with no call to System.exit()):public static void main(String args[]) throws Exception { JFrame jf = new JFrame(); jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); jf.setVisible(true);}您也可以尝试在退出之前运行垃圾收集器,只是为了好玩.You might also try running the garbage collector before exiting, just for kicks. 这篇关于退出 Swing 应用程序时偶尔出现 InterruptedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-28 16:41
查看更多