Everything has been working fine in my level editor program I've been working on until I decided to export the JAR file for a beta version. All the image loading works perfectly in Eclipse but once I try to run it as an external JAR file I get this error: http://puu.sh/kP681/1be9b77e21.png
Here is the code I'm using to load the image, it is working in Eclipse.
public static void main(String[] args) {
BufferedImage appIcon = null;
try {
appIcon = ImageIO.read(new File("res" + File.separator + "appicon.png"));
} catch (IOException e1) {
e1.printStackTrace();
}
JFrame frame = new JFrame("Mario Map Creator");
frame.setSize(RESELOUTION);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setIconImage(appIcon);
That doesn't appear to be working, that is the MapCreator class.
Then the MapCreatorPanel class
public MapCreatorPanel() {
this.setLayout(null);
try {
levelIcon = new ImageIcon(ImageIO.read(new File("res" + File.separator + "levelicon.png")));
flagIcon = new ImageIcon(ImageIO.read(new File("res" + File.separator + "flagicon.png")));
scriptIcon = new ImageIcon(ImageIO.read(new File("res" + File.separator + "scripticon.png")));
} catch (IOException e) {
e.printStackTrace();
}
scriptManager = new ScriptManager();
}
Thanks for your help in advance!
ALSO NOTE: I've looked at a bunch of other posts on this site and all their solutions didn't seem to work for me (unless I was doing something wrong).