JDK的文档里面写的:
DO_NOTHING_ON_CLOSE
Do nothing. This requires the program to handle the operation in the windowClosing method of a registered InternalFrameListener object. 也就是说this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)仅仅是屏蔽了windowClosing事件而已,并没有阻止关闭windows~~~~~~~~
DO_NOTHING_ON_CLOSE
Do nothing. This requires the program to handle the operation in the windowClosing method of a registered InternalFrameListener object. 也就是说this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)仅仅是屏蔽了windowClosing事件而已,并没有阻止关闭windows~~~~~~~~
HIDE_ON_CLOSE,而不是DO_NOTHING_ON_CLOSE