The button listener in the main class needs a reference to the instance of the other class so it can call a method in the other class where the window can be opened.