🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: images !!!!!!!!!!!!!!!!!!!!

#9097
From: sven goetgeluck
Date: Wed, 24 May 2000 00:00
41 lines
1781 bytes
Txs it worked

Greg Hamer wrote:

> ImageIcon throws a null pointer exception when the supplied URL cannot be
> located.
> It is better to specify the gif relative to a class, you just need to make
> sure that the gif file is in the right place relative to the class file. In
> your case, "directory.gif" needs to
> be in the same directory as the class file that contains the
> aliasChooser.setIcon() property setting. If you add the gif file to the
> project, and it is placed in the same directory as the java file, JBuilder
> will copy it over into the similar location on the output path.
>
> Sven Goetgeluck <sven.goetgeluck@pandora.be> wrote in message
> news:3921b074@dnews...
> > Hi,
> > when using icons from recources in project it crashes , when reading
> > directly from harddisk is works
> >
> > fe
> > menuFileExit.setIcon(new
> > ImageIcon("c:\\jBuilder3\\myprojects\\vrex4\\Stop16.gif"));
> > this works
> >
> >    aliasChooser.setIcon(new
> >
> ImageIcon(this.getToolkit().getImage(getClass().getResource("directory.gif")
> > )));
> > somethimes crashes
> >
> >
> > what could it be??
> >
> >
> >
> >
> > txs
> > sven.goetgeluck@pandora.be
> >
> >
Technical Details
Message-ID: <392B87BD.4F7C3C7F@officeline.be>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3921b074@dnews> <8fsbte$93v8@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,f6f93a95152ff73
X-Google-Attributes: gid111d45,public
From: sven goetgeluck <sven@officeline.be>
Subject: Re: images !!!!!!!!!!!!!!!!!!!!
Date: 2000/05/24
Message-ID: <392B87BD.4F7C3C7F@officeline.be>
X-Deja-AN: 626618753
Content-Transfer-Encoding: 7bit
References: <3921b074@dnews> <8fsbte$93v8@bornews.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 24 May 2000 00:32:25 -0800, 127.0.0.1
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing