How to get a method to run only after another method runs to completion
<p>I'm making a simple game involving lots of GUIs. The first time a user plays, I want the program to first open GameStart();. In there, the user learns the story, picks a class, and sets a name. A boolean variable gameStarted will be marked as true when the user clicks the last button in the GameStart class. </p>

<p>Now, any time the user opens the game again and loads a save file, gameStarted is true so it will skip the intro stuff.</p>

<p>My problem is that as is, the program doesn't execute anything after the first if statement. Below is what I have. </p>

<pre><code>public static void main(String[] args){
    if (!gameStarted){
        new GameStart();
        //use setters
    }

    if(gameStarted){
        //do the rest of the game
    }
}
</code></pre>

<p>If in between the if statements I add:</p>

<pre><code>while(!gameStarted){
    sysout("waiting")
}
</code></pre>

<p>it works, but obviously the console is flooded with waitings and that's bad. A blank while loop doesn't work. moving my setters from the if statement to the while loop doesn't work unless I have the sysout in there as well.</p>

<p>Any ideas?</p>