• Post Reply Bookmark Topic Watch Topic
  • New Topic

DISPOSE_ON_CLOSE vs EXIT_ON_CLOSE

 
Igor Stojanovic
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was wandering whats the difference between DISPOSE_ON_CLOSE and EXIT_ON_CLOSE ?

Maybe it means same thing but I find it difficult to understand since English isn't my native language




kind regards
Igor
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Igor Stojanovic
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much







kind regards
Igor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!