EXIT_ON_CLOSE terminates the program. Unlike the default, HIDE_ON_CLOSE, which simply hides the program, but continues to run in the background. DISPOSE_ON_CLOSE will recycle the program means that it will delete all program resources i.e.
If you have multiple JFrames open and close the one that has EXIT_ON_CLOSE, it will close all JFrames and exit the application.
If you close the one that DISPOSE_ON_CLOSE will only have that one JFrame will be closed.
Shubham soni
source share