Close window - but don't stop program - JAVA
问题 In my program it opens a window if an action is happened. After I have filled out information in this window, and entered a button, the window dispose(). The window is picked up in a program outside my main program, but when I close this window, my main program stops. How can I prevent this from happening? Thanks for your help! 回答1: You can set the defalaultCloseOperation property of the second frame to DO_NOTHING_ON_CLOSE or DISPOSE_ON_CLOSE Don't even use two frames. Use a modal JDialog