what is the difference between JFrame.EXIT_ON_CLOSE and JFrame.DISPOSE_ON_CLOSE?
which one do i need to use and when?
- 8 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
- 6 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...
- Anonymous6 years ago
don't know what to answer
- How do you think about the answers? You can sign in to vote the answer.
- 8 years ago