Hi everyone: I have a Java Swing application. There is a button that allows the user to create the opening of a new application window. I use System.Exit (0) when the user decides to close the application, however, when I click the Close button, both application windows close.
public static void main(String[] args)
{
ghMain = new GreenHouseMain();
}
The above describes how I initialize the first application and then use the same code to create a new GreenHouseMain object to open the second application window.
So my question is how to close only one application window from which I clicked the close button?
Thank you all
source
share