Article View: borland.public.jbuilder.java.language
Article #16205Re: How to access a GIF file in JB project or JAR?
From: Richard Wilkman
Date: Wed, 17 Mar 1999 00:00
Date: Wed, 17 Mar 1999 00:00
43 lines
2253 bytes
2253 bytes
Matt:
Images should be loaded via getResource() and/or URL mechanisms which
means that the get stored relative to the class that is using them.
For example, if you have a borland.jbcl.control.ButtonControl and
wanted to load an image for it, you would store (and look for it) in
the borland.jbcl.control location.
-Rich
Dr. Matt H. Stevens wrote:
>
> Hi all, I see it is possible to embed a GIF image file into a project
> and then include it into a JAR file via the deployment wizard. I like
> this, but how do I access or reference this GIF image from my java
> code, for example: this.setIconImageName("my.iconlib.upArrow.GIF");
> This doesn't work but it shows my intent. Right now we are having to
> put or install image files in a specific directory and then pass this
> directory location into the app via the "-D" option. This is bad since
> code has to be changed at the end of the development cycle to reflect
> how our software is java installed on one's computer system.
> Perferrablly, we want to embed these GIF's directly into the app's JAR
> file or into separate library such as "OurImageLib.JAR". How is the
> referenceing done correctly?
> Thanks in Advance, Matt
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team
If you see something that looks like an opinion up there,
it's mine and mine alone.
Mail sent to me from the newsgroups won't bounce but will
be ignored. If I have time, I'll respond, but you have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<36F0209F.DD68CE36@inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36F01A9F.7956871E@mmm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5aa3043313ad7e4a X-Google-Attributes: gidf74b3,public From: Richard Wilkman <rwilkman@inprise.com> Subject: Re: How to access a GIF file in JB project or JAR? Date: 1999/03/17 Message-ID: <36F0209F.DD68CE36@inprise.com> X-Deja-AN: 455879203 Content-Transfer-Encoding: 7bit References: <36F01A9F.7956871E@mmm.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language