agnesko
asked on
Access images from jar
I am writing an applet using JDK1.2 and found problem in accessing the images from the jar archives.
My program behaves normally without using jar. If using jar, all functions behave normally except displaying images.
How can I solve this problem?
Here are the details of my program:
The directory structure of my files like this:
\*.class
\images\*.jpg
I use this command to create the archives:
jar cvf all.jar *.class .\images\
I use this to extract the files and found that the result directory structure is the same as I have described.
jar xf all.jar
In my program, i use this to get the image.
Image image = applet.getImage(getDocumen tBase(), "./images/" + imageName);
My html files contain this:
<APPLET CODE=Applet.class ARCHIVE=all.jar WIDTH=600 HEIGHT=400></APPLET>
My program behaves normally without using jar. If using jar, all functions behave normally except displaying images.
How can I solve this problem?
Here are the details of my program:
The directory structure of my files like this:
\*.class
\images\*.jpg
I use this command to create the archives:
jar cvf all.jar *.class .\images\
I use this to extract the files and found that the result directory structure is the same as I have described.
jar xf all.jar
In my program, i use this to get the image.
Image image = applet.getImage(getDocumen
My html files contain this:
<APPLET CODE=Applet.class ARCHIVE=all.jar WIDTH=600 HEIGHT=400></APPLET>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER