I have an Applet I'm trying to embed into a html file after packaging into a jar file.
Images are loaded in the main Applet Class with the following line
return getImage(getClass().getResource("/../content/"+path));
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
InputStream is = new BufferedInputStream(
getClass().getResourceAsStream("/../content/"+path));
return ImageIO.read(is);
but this doesn't work through eclipse.
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