My application icon works fine when running the app from Eclipse, but once I export it as a runnable jar, then it doesn't appear.
This is the code I use to set the icon:
try {
setIconImage(ImageIO.read(new File("resources/icons/icon.png")));
}
catch (IOException exc) {
exc.printStackTrace();
}
The icon is in a source-folder called resources/icons
.
Why doesn't the icon get included in the export?
Using URL now instead of looking for the icon with the File
method. This works great!
Is it possible to change - by default - the file's icon? I think I have to use resource hacker or something like that in order to change it. But if it's possible via code, I'd love to learn it!