【发布时间】:2016-01-30 04:37:22
【问题描述】:
mainGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Intellij 代码分析:
警告:(33, 46) 必须是以下之一:WindowConstants.DO_NOTHING_ON_CLOSE, WindowConstants.HIDE_ON_CLOSE,WindowConstants.DISPOSE_ON_CLOSE, WindowConstants.EXIT_ON_CLOSE
那么,使用WindowConstants.EXIT_ON_CLOSE 比使用JFrame.EXIT_ON_CLOSE 更好吗?
为什么?
【问题讨论】:
-
检查this链接,看看是否有帮助。
-
JFrame实现WindowConstants
标签: java swing intellij-idea jframe