Java: WindowAdapter windowClosed method not running
问题 I'm currently running this in a class that extends a JFrame. When I close the window, I don't see RAN EVENT HANDLER in the console. This is not the main window, and more than one instance of this window can exist at the same time. this.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { System.out.println("RAN EVENT HANDLER"); } }); This method is inside a method called initialiseEventHandlers() which is called in the constructor, so I'm sure the code