🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8588

Re: icons in resouce files

#8588
From: ross
Date: Wed, 09 Aug 2000 00:00
43 lines
2014 bytes
Will this work for a JApplet ?


Joi Ellis <joi@aravox.com> wrote in message
news:39916BA2.F23915FD@aravox.com...
> Helge Smebye wrote:
> >
> > Hello,
> >
> > Are there some way to include all the icons in a jar or some other file
> > type, and then access them in designtime and runtime from a applet ?
> >
> > -helge
>
> Sure.  Stick a gif into the same directory as a java class which
> desires to load it.  Add it to your JBuilder project from that
> location so that JBuilder will handle copying it over to the classes
> tree at compile time.
>
> In your java file, load the icon with something like this:
>
> selectIcon = new ImageIcon( getClass().getResource( "EastArrow.gif" ) );
>
> This code will execute no matter what form the application is deployed
> in, ie jar file, directory tree, etc.
>
> This may not work at design time, though.  Last time I looked,
> Jbuilder used platform-specific hardcoded paths to access the icons.
> :(  So your code isn't portable.
>
> Perhaps someone can suggest a method that's both portable and
> JBuilder-friendly?
>
>
>
> --
> Joi Ellis                    Software Engineer
> Aravox Technologies          joi@aravox.com, gyles19@visi.com
>
> No matter what we think of Linux versus FreeBSD, etc., the one thing I
> really like about Linux is that it has Microsoft worried.  Anything
> that kicks a monopoly in the pants has got to be good for something.
>            - Chris Johnson
Technical Details
Message-ID: <3991dbce$1_2@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <399132b2$1_1@dnews> <39916BA2.F23915FD@aravox.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,59ce72ffe7b40e6e
X-Google-Attributes: gid111d45,public
From: "ross" <rperry@commonvision.com>
Subject: Re: icons in resouce files
Date: 2000/08/09
Message-ID: <3991dbce$1_2@dnews>
X-Deja-AN: 656537847
References: <399132b2$1_1@dnews> <39916BA2.F23915FD@aravox.com>
X-Trace: 9 Aug 2000 15:31:42 -0800, 209.113.90.125
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300