> I,ve recently put all my application files into a jar file,
> only to discover that the .jpg images are loaded into the
> jar file but not recognised when executed.
What does that mean exactly, are exceptions thrown
when you try to load them? If so, what exceptions?
<http://www.physci.org/codes/javafaq.jsp#exact>
>...All the other files work fine.
Are there any other files besides classes?
> Can anyone tell me what is wrong and a possible solution?
Probably that the .jpg's are not being found*.
<http://www.physci.org/codes/javafaq.jsp#path>
[ * Though it is quite hard to say without seeing your code. ]

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
peter2929 - 26 Nov 2004 23:13 GMT
> > I,ve recently put all my application files into a jar file,
> > only to discover that the .jpg images are loaded into the
[quoted text clipped - 14 lines]
>
> [ * Though it is quite hard to say without seeing your code. ]
Ok, let my clarify.
There is nothing wrong with the code, no errors or exceptions occur.
The app works perfectly well without the jar file on its own,
recognising all the external files (.jpg and .txt) and loading
them into the app as expected. (No problems here).
When I put them into my jar file, which is executable, they increase
the file size as expected, but when I double click my Jar file,
the app works as normal but with all the .jpg images missing!
Thats the problem. I tried putting them into a seperate folder,
but it made no difference. If I put the jar file back into the
folder with all the images, then it works fine, because it is still
looking for those images and not the ones I put inside the jar file.
I hope all this makes sense, I don't intend posting 0ver 300 lines of
code, I guess that would annoy a few people.
many thx Peter.
Andrew Thompson - 27 Nov 2004 03:09 GMT
> ..I don't intend posting 0ver 300 lines of
> code, I guess that would annoy a few people.
Trim it to a 30 line version that displays the same behaviour.
<http://www.physci.org/codes/sscce.jsp>

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
> Hello all,
>
[quoted text clipped - 5 lines]
>
> Many thx Peter.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html#getResourceAs
Stream(java.lang.String)

Signature
Tony Morris
http://xdweb.net/~dibblego/