Anh Le wrote:

> I'm trying to run an applet from reading a jar file. I want to make a jar
> file as follow:
>
> jar cvf test.jar *.class audio images
>
> such that audio and images are two directories which contain audio clips and
> image files, some how it can not load images from images directory.
>
> It runs OK with out reading from jar file.
> Any body know the answer, it's a big help.

Strictly speaking, not a J3D question, but I know the answer anyway.

There are known bugs with the standard Java implementation of JAR files
that don't allow you to read images using the normal stuff.

Basically, to do it properly, you need to use the ClassLoader to get the
resource URL and then ask Toolkit to createImage(URL). This works in 90%
of cases. The other 10% are due to failings in the way that Java does
it's JAR file handling that are incorrect.

--
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [EMAIL PROTECTED]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to