凌动小生的Blog

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

If you have several JFrames open and you close one that has EXIT_ON_CLOSE it will close all the JFrames and exit the app.

If you close one that has DISPOSE_ON_CLOSE only that one JFrame will be closed.

If you only have one JFrame there isn't a real difference unless you have other non-deamon threads running.

let's say you have an application which opens with a login dialog box

after logging in
DISPOSE_ON_CLOSE will dispose of the login dialog box, then proceed with the rest of the program
EXIT_ON_CLOSE will terminate the program

posted on 2013-12-18 10:47  凌动小生  阅读(840)  评论(0编辑  收藏  举报