public SceneManager setWindowForTerminating ( Window window ) { this . window = window ; window . addWindowListener ( new WindowAdapter ( ) { @ Override public void windowClosing ( WindowEvent e ) { terminate ( ) ; } @ Override public void windowClosed ( WindowEvent e ) { terminate ( ) ; } } ) ; return this ; }
Sets the specified window . The window will be disposed when terminating this manager . This manager will also be terminated when closing the window .