title: SwingUtilities.invokeLater() displaying just during one frame
body: <p>I'm using Swing in order to create a little java 2D game. I only try to display an image. Since i'm not on the EDT I'm using SwingUtilities.invokeLater() to do the stuff. When I use it, image is not displayed (in fact it's displayed during few miliseconds and disapear).
  When I don't use SwingUtilities.invokeLater() the image is correctly displayed but I need to use invokeLater().</p>
  
  <p>Here's my basic code :</p>
  
  <pre><code>public class Test {
  
  /**
   * @param args
   */
  public static void main(String[] args) {
      try {
          SwingUtilities.invokeAndWait(new Runnable() {
  
              @Override
              public void run() {
                  final BreizhFrame frame = new BreizhFrame();
                  File imgFile = new File("src/test/lvl1-800x450.jpg");
                  System.out.println(String.valueOf(imgFile.exists()));
                  System.out.println(SwingUtilities.isEventDispatchThread());
                  Image i;
                  try {
                      i = ImageIO.read(imgFile);
                      frame.getGraphics().drawImage(i, 0, 0, null);
                  } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
              }
          });
      } catch (InvocationTargetException | InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any idea ?</p>
  
  <p>Thanks.</p>