Article View: borland.public.jbuilder.java.language
Article #7390How do you replace image/icon associated with a label?
From: swett
Date: Mon, 25 Jun 2001 22:19
Date: Mon, 25 Jun 2001 22:19
15 lines
1474 bytes
1474 bytes
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:
<3b37bb9c_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,7b878d1fe4201fff,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-25 15:34:31 PST Reply-To: <swett@bcswebsite.com> From: <swett@starband.com> Newsgroups: borland.public.jbuilder.java.language Subject: How do you replace image/icon associated with a label? Date: Mon, 25 Jun 2001 18:19:20 -0400 Lines: 17 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 148.71.34.6 Message-ID: <3b37bb9c_1@dnews> X-Trace: dnews 993508252 148.71.34.6 (25 Jun 2001 15:30:52 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews