| Author |
Reading images from a JAR file on build path
|
Jack Bernstein
Greenhorn
Joined: Jan 13, 2010
Posts: 12
|
|
I have a jar file of a bunch of images. I'd like to be able to read an image from the file. I know how to do this if I just put the jar into my project, but how do you do this when the jar is included as a library on your build path? It doesn't seem to work the same.
Below is a test program that works if the jar is included in my project, but does not work when the jar is included in the build path.
Thanks in advance for any help!
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Check out how Class.getResource and ClassLoader.getResource (and their helper methods getResourceAsStream) work.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Reading images from a JAR file on build path
|
|
|