Article View: borland.public.jbuilder.java.language
Article #7391Re: How do you replace image/icon associated with a label?
From: Calvin R. Smith
Date: Mon, 25 Jun 2001 22:34
Date: Mon, 25 Jun 2001 22:34
23 lines
1674 bytes
1674 bytes
what about using setIcon? <swett@starband.com> wrote in message news:3b37bb9c_1@dnews... > My application creates image icons from JPG files and then displays them in > a label. This is for displaying student pictures as the user moves from one > kid to another. > > There is probably a better way than mine to replace the image associated > with the label. I'm basically rebuilding it all, which seems like I'll take > a performance hit. If there is a better way than the following, please > share. Thank you. > > PicturePanel.remove(PictureLabel); > PicturePanel.repaint(); > PictureIcon = new ImageIcon(PictureURL); // URL to JPG file > PictureLabel = new JLabel(PictureIcon) > PictureLabel.setBounds(....... > PicturePanel.add(PictureLabel,null); > >
Technical Details
Message-ID:
<3b37bcdd$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b37bb9c_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,7b878d1fe4201fff X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-25 15:40:01 PST From: "Calvin R. Smith" <calvinrsmith@hotmail.com> Newsgroups: borland.public.jbuilder.java.language References: <3b37bb9c_1@dnews> Subject: Re: How do you replace image/icon associated with a label? Date: Mon, 25 Jun 2001 16:34:46 -0600 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 207.201.104.90 Message-ID: <3b37bcdd$1_2@dnews> X-Trace: dnews 993508573 207.201.104.90 (25 Jun 2001 15:36:13 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews