Fix unable to dismiss device frame due to windowClosing is part of the WindowListener interface. Use addWindowListener instead of addWindowStateListener. WindowStateListener is used to handle events that are triggered when the window is minimized or maximized, etc, but not closed