Article View: borland.public.jbuilder.java.swing
Article #1086Re: Two last problems
From: pnichols
Date: Tue, 23 Mar 2004 22:43
Date: Tue, 23 Mar 2004 22:43
25 lines
2044 bytes
2044 bytes
Ted Byers wrote:
>
>
> Is this correct for an applet?
> Will this work in a browser once I figure out how to make a jar file?
>
If you do not have the image in the jar file, how can you assure that the
image is on the correct class path for the applet?
In other words, remember that the image as run in applet viewer, is looking
at the image as residing in the same class folder as the applet when run
from the HTML page. When downloaded from a Web Server, the image MUST STILL
BE on the same classpath as your applet class that is using
getClass().getResource("imagename.gif");
Once you download an applet from a Web Server, the cache folder where the
applets are stored, is WHERE THE CLASSPATH IS. So it is no longer in the
same class path as it was in JB, it is now whereever your version of IE
places it. If the image is not in that same, folder, it will not work.
Once you place all of this into a jar file, the equation changes, since the
classpath becomes the .jar file. If the image is on the classes classpath
where your image jLabel is located, then it will display. Otherwise, it
will not.
Technical Details
Message-ID:
<4060b978@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40609ab3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,52654c77b754f7e3 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-03-23 14:40:17 PST Message-ID: <4060b978@newsgroups.borland.com> From: pnichols <paul@comp.net> Subject: Re: Two last problems Newsgroups: borland.public.jbuilder.java.swing Reply-To: paul@comp.net Mail-Copies-To: paul@comp.net Date: Tue, 23 Mar 2004 17:43:56 -0500 References: <40609ab3$1@newsgroups.borland.com> Lines: 28 Organization: clc User-Agent: KNode/0.7.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit NNTP-Posting-Host: 68.71.188.25 X-Trace: newsgroups.borland.com 1080080760 68.71.188.25 (23 Mar 2004 14:26:00 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail