title: Exception in thread "AWT-EventQueue-0" - uncompilable source code?
body: <p>I have two simple classes that I found in some tutorial:</p>
  
  <pre><code>package skeleton;
  
  import java.awt.EventQueue;
  import javax.swing.JFrame;
  
  public class Skeleton extends JFrame 
  {
  
      public Skeleton() 
      {
          add(new Board());
  
          setTitle("Star");
          pack();
          setResizable(false);
          setLocationRelativeTo(null);        
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      }
  
      public static void main(String[] args) 
      {
          EventQueue.invokeLater(new Runnable() {            
              @Override
              public void run() {
                  JFrame ex = new Skeleton();
                  ex.setVisible(true);             
              }
          });
      }
  
  } // End Skeleton
  </code></pre>
  
  <p>and</p>
  
  <pre><code>package Skeleton;
  
  import java.awt.Color;
  import java.awt.Dimension;
  import java.awt.Graphics;
  import java.awt.Graphics2D;
  import java.awt.Image;
  
  import java.awt.Toolkit;
  import java.awt.event.ActionEvent;
  
  import java.awt.event.ActionListener;
  
  import javax.swing.ImageIcon;
  import javax.swing.JPanel;
  import javax.swing.Timer;
  
  public class Board extends JPanel 
      implements ActionListener {
  
      private final int B_WIDTH = 350;
      private final int B_HEIGHT = 350;
      private final int INITIAL_X = -40;
      private final int INITIAL_Y = -40;
      private final int DELAY = 25;
  
      private Image star;
      private Timer timer;
      private int x, y;
  
      public Board() {
  
          loadImage();
          initBoard();        
      }
  
      private void loadImage() {
  
          ImageIcon ii = new ImageIcon("star.png");
          star = ii.getImage();        
      }
  
      private void initBoard() {
  
          setBackground(Color.BLACK);
          setPreferredSize(new Dimension(B_WIDTH, B_HEIGHT));
  
          setDoubleBuffered(true);
  
          x = INITIAL_X;
          y = INITIAL_Y;
  
          timer = new Timer(DELAY, this);
          timer.start();
      }
  
      @Override
      public void paintComponent(Graphics g) {
          super.paintComponent(g);
  
          drawStar(g);
      }
  
      private void drawStar(Graphics g) {
  
          Graphics2D g2d = (Graphics2D) g;
          g2d.drawImage(star, x, y, this);
          Toolkit.getDefaultToolkit().sync();
          g.dispose();        
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
  
          x += 1;
          y += 1;
  
          if (y &gt; B_HEIGHT) {
  
              y = INITIAL_Y;
              x = INITIAL_X;
          }
  
          repaint();  
      }
  }
  </code></pre>
  
  <p>This is supposed to animate something, but compiling the code gives me an error:</p>
  
  <pre><code>run:
  Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: &lt;any&gt;
      at skeleton.Skeleton.&lt;init&gt;(Skeleton.java:11)
      at skeleton.Skeleton$1.run(Skeleton.java:25)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
      at java.awt.EventQueue.access$000(EventQueue.java:101)
      at java.awt.EventQueue$3.run(EventQueue.java:666)
      at java.awt.EventQueue$3.run(EventQueue.java:664)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
  BUILD SUCCESSFUL (total time: 1 second)
  </code></pre>
  
  <p>What's wrong? Although there's build successful written, nothing happens.</p>