Hello, I created the .jar file for distribution. There are some .class files there and an Image directory with several .gif files I use as icons. I run the application with the command: java -classpath ".;MyJar.jar" MainClass Everything runs fine, but there are no icons on my GUI :-(. It works fine if I copy the Image directory to current directory (.). But I do not want to do it. When I use jar -tf MyJar.jar I can see, that Image directory with all gifs is there. How can I avoid copying the Image directory?
As Steven suggests, the problem is probably with the methods you use to load the images. If you can post the code that does this, we can help give more specific suggestions how to fix it. I think Steven's suggestion for using the getResource() methods will probably help. If not please post some code so we can help further. You should also google for more information about using resources in Java.