I have a simple GUI program that creates a new window (which contains a JTable) at some point in time. If the user closes the JTable, the main application closes as well. How do I prevent this? Would it have something to do with how it handles the window closing, or should I give it it’s own thread, or what?
I have a simple GUI program that creates a new window (which contains a
Share
Set one of these close operation for your
JFrame:HIDE_ON_CLOSEorDISPOSE_ON_CLOSE.You are using
EXIT_ON_CLOSE.Here is a link to the JavaDoc method you can use.