title: Simple way to wait for a method to finish before starting another one
body: <p>I'm not familiar at all with Java threading :(. I have this class which, when called, constructs a new window (draw() method). The drawGUI() calls a processing method at the end (compare() method).</p>
  
  <p>basically the structure is</p>
  
  <pre><code>public static void draw() {
      // draws stuff
  
  
      compare();
  }
  </code></pre>
  
  <p>The problem is that the window drawn by drawGUI() has some major visual artifacts till the processing (compare() ) is over.</p>
  
  <p>What is the simplest way I can implement to launch compare() after draw() has finished executing? Thank you</p>