| Author |
How to load a resource in a .jar
|
Charles Mulloy
Ranch Hand
Joined: Oct 25, 2009
Posts: 30
|
|
I've looked around and couldn't figure out how this is done.
I'm trying to load an image in a .jar, but the jar is executable. Both the main class and the image are in the same .jar. I'm trying to use the setIconImage() method. I'm using the code HERE to learn how. It works perfectly outside the jar, but not inside. How do I tell java to access files inside the jar?
|
 |
Chinna Eranna
Ranch Hand
Joined: Dec 08, 2009
Posts: 174
|
|
|
http://www.java-tips.org/java-me-tips/midp/how-to-read-a-resource-from-a-jar-file.html
|
- Chinna
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32644
|
|
There should be something in the Java™ Tutorials about how to put your image in a .jar. Try putting the image in the top-level folder you are zipping; it might be a problem with the location of the image file.
I think this is too difficult for "beginning".Moving thread.
|
 |
 |
|
|
subject: How to load a resource in a .jar
|
|
|