Article View: borland.public.jbuilder.java.api
Article #1236Re: how do I draw a JPG to a panel/container
From: Gillmer J. Derge [TeamB]
Date: Tue, 16 Apr 2002 21:43
Date: Tue, 16 Apr 2002 21:43
17 lines
1886 bytes
1886 bytes
"PeterH" <!REMOVEBeforeSending!peter@pchenry.com> wrote in message news:3cbc80fd$1_2@dnews... > In the JFrame object, there is a getGraphics() method. How come I can't use > that to get a Graphics object and use the drawImage() from there? That probably works except your work is destroyed before you even see it. The problem is that the paint method is called automatically in response to various user interface events. For example, when the window first appears on the screen or when the window is uncovered by moving another window, the paint method will be called to draw the window's contents. Your approach drew the image, but then at some point paint was called, and it redrew the window right on top of your work. That's why overriding paint or paintComponent will work. -- Gillmer J. Derge [TeamB]
Technical Details
Message-ID:
<3cbc9afb_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!sfo2-feed1.news.algx.net!allegiance!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3cb9ef73$1_1@dnews> <MPG.172579c5bd0dc2ea98b534@newsgroups.borland.com> <3cbc80fd$1_2@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-16 14:49:41 PST From: "Gillmer J. Derge [TeamB]" <spam@gillmerderge.com> Newsgroups: borland.public.jbuilder.java.api References: <3cb9ef73$1_1@dnews> <MPG.172579c5bd0dc2ea98b534@newsgroups.borland.com> <3cbc80fd$1_2@dnews> Subject: Re: how do I draw a JPG to a panel/container Date: Tue, 16 Apr 2002 17:43:45 -0400 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 24.29.81.241 Message-ID: <3cbc9afb_2@dnews> X-Trace: dnews 1018993403 24.29.81.241 (16 Apr 2002 14:43:23 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!sfo2-feed1.news.algx.net!allegiance!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews