Can not load the images in Java Swing when running from a .jar-file?

Use the absolut path inside your jar. If you don't know it, try opening the JAR with a zip programm, e.g. 7zip. Then use the absolute path.

Use the absolut path inside your jar. If you don't know it, try opening the JAR with a zip programm, e.g. 7zip. Then use the absolute path: getClass().

GetResource("/com/examples/images/logo. Png") This obiously only works when your image is in your jar. If its not, but in your classpath, this should be fine too.

The images should be packed as well in a jar file. Actually, I'm not 100% sure there is no other solution, but at least I made it work this way, when experimenting the same issue. The jar was then added to the classpath, and I'm accessing image resources this way: getResource("images/logo.

Png").

As what I know, they are in the jar-file already. – Jonas May 28 '10 at 7:42 @Jonas - Make sure their folder is correctly added to the classpath. – Gnoupi May 28 '10 at 7:44.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions