title: Java throwing NullPointerException when loading Images using getClass().getResource()
body: <p>I have an Applet I'm trying to embed into a html file after packaging into a jar file.</p>
  
  <p>Images are loaded in the main Applet Class with the following line</p>
  
  <p><code>return getImage(getClass().getResource("/../content/"+path));</code></p>
  
  <p>This works when running through eclipse but when I export it to a jar file I get a Null Pointer Exception. I've done some googling and I've tried to use getResourceAsStream with the following code</p>
  
  <pre><code>InputStream is = new BufferedInputStream(
                   getClass().getResourceAsStream("/../content/"+path));
  return ImageIO.read(is);
  </code></pre>
  
  <p>but this doesn't work through eclipse.</p>
  
  <p>Content is the top level directory of the images and path is the specified path to the required image. The applet is in a folder called game, which is at the same level as content</p>