how to check if window is open?
I am trying to create a button that will launch a new window. But I want it to check to make sure that the window trying to be launched is not already open. I am having issues I believe because the button is in one java file (class) and the window to be opened is a JFrame implemented in a different class.
ActionListener prefListener =new ActionListener(){
publicvoid actionPerformed(ActionEvent e){
System.out.println("Loading prefs...");
WindowPrefs WindowPrefs;
WindowPrefs =new WindowPrefs();
if (WindowPrefs.isVisible() !=true)
{
WindowPrefs.setVisible(true);
}
}
};
Currently, it will just open a new instance of the window over the old one and the windows will stack to infinity if you keep pressing the "launch window" button. Should I be using a listener
Can sombeody help?

