I am having a simple question, but somewhat questionable. This is the situation.
In my application, you can open new windows by clicking the new button. When you click the "X" (close) button, it will first ask whether you want to save your work. If no, it will use system.exit(0) to exit. The case is, this closes all the open "new" windows. I want to close only the window which user selected the option "no save". How can I do this? Please help!
System.exit(...)if you don't want to kill the JVM. Do tell us more details if you still need our help. What kind of "windows" are you displaying? JDialogs (this would probably be a good thing to do)? JFrames? How does your code record the state of the windowing object -- whether it is to be saved or not?JTabbedPane2)JDesktopPane/JInternalFrames 3)CardLayout4) ..