Displaying JFrame
===

I'm having issues figuring out how to open one window when another closes if the other window is initiated within a sub class. Here is the clumsy code I am trying to use, but it halts the setting visible of the sub classe's window. Perhaps due to it being within an action event or perhaps it is halting the main thread. 

        tutorial = new tutorialWindow();
        this.setVisible(false);
        tutorial.setLocationRelativeTo(null);
        tutorial.setVisible(true);
        tutorial.setCurrentUser(users.getCurrentUser());
        
        while(tutorial.isOpen() == true ) {
        }
        this.setVisible(true);
        users.updateUser(tutorial.getCurrentUser());

My thoughts were that it would just get stuck in the section of code until the other window closes and would then appear again when the tutorialWindow has a Open boolean set to false due to it breaking the while loop. 

Im sure this is a matter of using correct threads, or perhaps the various notify methods but as of now I am not sure how to do that. 

Thanks,
Liam