title: What is SwingUtilities.invokeLater
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6567870/what-does-swingutilities-invokelater-do">What does SwingUtilities.invokeLater do?</a><br>
    <a href="https://stackoverflow.com/questions/7196889/swingutilities-invokelater">SwingUtilities.invokeLater</a>  </p>
  </blockquote>
  
  
  
  <p>I have seen this little piece of code hundreds of times:</p>
  
  <pre><code>public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
          }
      });
  }
  </code></pre>
  
  <p>Now my question is: what does <code>invokeLater()</code> do? What kind of bad things will happen if I just create and show my GUI inside the main thread?</p>