title: Java game not working
body: <p>I found this java source code for a brick breaker game online. I downloaded it and tried to run it but it gives me a NullPointerException. What is giving this exception and how do I fix it? Thanks.</p>
  
  <p><a href="http://zetcode.com/tutorials/javagamestutorial/breakout/" rel="nofollow">http://zetcode.com/tutorials/javagamestutorial/breakout/</a></p>
  
  <p>Here is the stacktrace:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at javax.swing.ImageIcon.&lt;init&gt;(ImageIcon.java:181)
      at Ball.&lt;init&gt;(Ball.java:16)
      at Board.gameInit(Board.java:48)
      at Board.addNotify(Board.java:43)
      at java.awt.Container.addNotify(Container.java:2578)
      at javax.swing.JComponent.addNotify(JComponent.java:4685)
      at java.awt.Container.addNotify(Container.java:2578)
      at javax.swing.JComponent.addNotify(JComponent.java:4685)
      at java.awt.Container.addNotify(Container.java:2578)
      at javax.swing.JComponent.addNotify(JComponent.java:4685)
      at javax.swing.JRootPane.addNotify(JRootPane.java:739)
      at java.awt.Container.addNotify(Container.java:2578)
      at java.awt.Window.addNotify(Window.java:663)
      at java.awt.Frame.addNotify(Frame.java:470)
      at java.awt.Window.show(Window.java:859)
      at java.awt.Component.show(Component.java:1584)
      at java.awt.Component.setVisible(Component.java:1536)
      at java.awt.Window.setVisible(Window.java:842)
      at Breakout.&lt;init&gt;(Breakout.java:14)
      at Breakout.main(Breakout.java:18)
  Exception in thread "Timer-0" java.lang.NullPointerException
      at Board$ScheduleTask.run(Board.java:110)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)
  </code></pre>
  
  <p>Apparently this code is supposed to work, but it isn't.</p>