Well, I finished my conversion to keeping my content in JAR files and it
works pretty well... one problem though.  When it comes to placing sound
files in the JAR, I remembered that the MediaContainer that takes an
InputStream as a constructor is broken in J3D 1.2.  As it stands, I
cannot use getResourceAsStream() because of this.

**** SUN, please tell me this is fixed in the next release....

-Lee
J. Lee Dixon
Software Engineer
SAIC - Celebration, FL
[EMAIL PROTECTED]


-----Original Message-----
From: J. Lee Dixon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 12, 2000 1:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Including images in a jar file


I am looking into using this right now for my web-based applet.  Keeping
images in the JAR file is an ideal way to go.  First, this keeps all the
class files and content files (3D models, textures) in one file.
Downloading one file is faster than multiple files, also JARs are
compressed which also decreases download time.  Also, the browser caches
the JAR and notices when it changes at the server and re-downloads as
necessary.  I was right in the middle of writing my own data cacher when
I figured this out.

Plus, when I do this in IE, I get a download status window to boot.  I'm
happy!  Now I just have to extend my model and texture loading routines
to load using resources instead of URLs...

PS: This would be a great section for a "How do I publish my Java3D
applet on the web" FAQ...  :)

-Lee
J. Lee Dixon
Software Engineer
SAIC - Celebration, FL
[EMAIL PROTECTED]


-----Original Message-----
From: Barry Walsh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 12, 2000 12:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Including images in a jar file


I haven't tried this myself, but I have been told that the following
might
help.

instead of

ImageIcon icon = new ImageIcon(getClass().getResource("image.gif"));

try:

.getResourceAsStream();

I don't know the details, but some info is available at

http://developer.netscape.com/docs/technote/java/getresource/getresource
.htm
l

Cheers,

B.


-----Original Message-----
From: Damir Arh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 12, 2000 11:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Including images in a jar file


Hello!

> to load images from the jar file you have to use the getResource()
> method. I use something like this:

> ImageIcon icon = new ImageIcon(getClass().getResource("image.gif"));

Thanks. It works now. At the same time it solved my problem with IE not
wanting to load the images at all. Unfortunately Netscape 4.5 still
doesn't
want to load the image from the JAR although I use the Plug-In in both
Netscape and IE.

I'll probably try upgrading Netscape to 4.75 and see if that helps.

Kind regards
--
Damir Arh
http://damir.gajba.net

========================================================================
===
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".

========================================================================
===
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".

========================================================================
===
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".

===========================================================================
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