what is the difference between JFrame.EXIT_ON_CLOSE and JFrame.DISPOSE_ON_CLOSE?
which one do i need to use and when?
- 9 years agoFavorite Answer
EXIT_ON_CLOSE will exit your program, vs DISPOSE_ON_CLOSE which will just close that JFrame. So if you have a program that has a main window and can make child windows you would want the main to EXIT_ON_CLOSE which would kill your program, and the children to DISPOSE_ON_CLOSE so that only that child window is closed, your program keeps running, and the main window stays open
- 7 years ago
Dispose closes the JFrame and clears up the memory while Exit closes the main window when the JFrame is closed by clicking on close button...
- Anonymous7 years ago
don't know what to answer
- How do you think about the answers? You can sign in to vote the answer.
- 9 years ago