Article View: borland.public.jbuilder.java.api
Article #1227Re: how do I draw a JPG to a panel/container
From: John McGrath TeamB
Date: Tue, 16 Apr 2002 04:59
Date: Tue, 16 Apr 2002 04:59
20 lines
1487 bytes
1487 bytes
On Sun, 14 Apr 2002 17:00:07 -0400, PeterH wrote:
> I thought I could just use a drawImage() method, but I can't
> seem to get it to work. I can get it to work if I use an Icon
> and a JLabel, but I was hoping to avoid using a JLabel for an
> image.
>
> Can I draw an image to a container? Thanks.
Yes, you can draw an image on any Swing component. Just override the
paintComponent() method and draw it.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.172579c5bd0dc2ea98b534@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3cb9ef73$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,422c9cef40be2392 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-04-15 22:01:05 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.api Subject: Re: how do I draw a JPG to a panel/container Date: Tue, 16 Apr 2002 00:59:38 -0400 Message-ID: <MPG.172579c5bd0dc2ea98b534@newsgroups.borland.com> References: <3cb9ef73$1_1@dnews> X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 1018933176 209.92.40.60 (15 Apr 2002 21:59:36 -0700) Lines: 20 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews