🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Can I make an invisible control?

#1162
From: Ted Byers
Date: Fri, 19 Mar 2004 20:23
37 lines
2811 bytes
"Gillmer J. Derge (TeamB)" <spam@gillmerderge.com> wrote in message
news:405b28d5$3@newsgroups.borland.com...
> Ted Byers wrote:
> > But here is another question about the use of JLabel within the
designer.
> > Is it possible to get it to load an image at design time?  Without that
> > capability, it is rather hard to visually place my invisible JLabels.
>
> The easiest way is to include the image file in your project.  It needs
> to be an explicit node in the project, not automatically discovered as
> part of the source tree.  For example,
>
> 1. Project | Add Files / Packages / Classes...
> 2. Browse to the file
>
> Now you should be able to select that image in the designer as the value
> of the label's "icon" property.
>
OK, I am part way there.  I added a jpeg and a couple gifs to the project
directory, and added them to the project.  They now appear in the drop down
list for icon.  However, that field won't let me type anything, and nothing
happens when I select one of the graphics files.  And nothing appears in the
source listing referring to the image I selected.  When I right click the
file name in the project window, I see an item "New" which brings  up a
submenu containing class, interface, and file.  And JLabel's setIcon
function won't take a file name as an argument.  And when I try
"jLabel1.setIcon(createImageIcon("daynite.gif","a pretty picture"));",
JBuilder tells me it can't resolve createImageIcon().  I must be missing a
key step.

Any ideas on why it adds the file names to the drop down menu for the JLabel
and yet does not actually allow any of my image files to be added to it?

Cheers

Ted
Technical Details
Message-ID: <405b55d4$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!HSNX.atgi.net!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <405b119a$1@newsgroups.borland.com> <405b1413$1@newsgroups.borland.com> <405b1da8$1@newsgroups.borland.com> <405b1f78$1@newsgroups.borland.com> <405b2349$1@newsgroups.borland.com> <405b28d5$3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,713e84ee88d10114
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-03-19 12:22:30 PST
From: "Ted Byers" <r.ted.byers@sympatico.ca>
Newsgroups: borland.public.jbuilder.java.swing
References: <405b119a$1@newsgroups.borland.com> <405b1413$1@newsgroups.borland.com> <405b1da8$1@newsgroups.borland.com> <405b1f78$1@newsgroups.borland.com> <405b2349$1@newsgroups.borland.com> <405b28d5$3@newsgroups.borland.com>
Subject: Re: Can I make an invisible control?
Date: Fri, 19 Mar 2004 15:23:33 -0500
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 65.95.240.180
Message-ID: <405b55d4$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1079727572 65.95.240.180 (19 Mar 2004 12:19:32 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!HSNX.atgi.net!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail