My images will not load when running a JAR file exported from Eclipse.
I have the images in a resources class package. I\'ve tried a images source folder as well wit
Unless you have to have you files in the jar, this is probably the simplest way of doing it:
header = ImageIO.read(new File("./resources/header.jpeg"));
header has to be an Image/BufferedImage. This goes to the folder that the runnable jar is within and looks for a folder called resources. http://i.stack.imgur.com/x8xtO.png
Two Simple steps:
1 - Add the folder to Build Path;
2 - Use this:
InputStream url = this.getClass().getResourceAsStream("/load04.gif");
myImageView.setImage(new Image(url));