🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1176

Re: how do I draw a JPG to a panel/container

#1176
From: Gillmer J. Derge [TeamB]
Date: Thu, 18 Apr 2002 15:17
27 lines
2419 bytes
"PeterH" <!Sorry-TooMuchSpam!nope@nope.com> wrote in message
news:3cbe170c$1_2@dnews...
> I've been hearing things about doing things with a double buffer instead
of
> in memory, or objects that are directly being used to display on the
screen.
> Could you point me in the right direction to start finding information
on?
> Much appreciated.

Double buffering basically means that rather than painting directly to the
screen you paint to an off-screen image.  The image is then copied to the
screen at once.  This can help reduce flickering with components that have
complicated paint methods or with components that display animation.

The good news is that Swing components automatically use double buffering.
That's another reason to override paintComponent instead of paint.  One of
the things the paint method does is to manage double buffering for you.  So
you probably don't need to do anything new with your component.

One place to find out more about double buffering and painting components
is the section of the Java Tutorial on painting.

http://java.sun.com/docs/books/tutorial/uiswing/overview/draw.html

--
Gillmer J. Derge [TeamB]
Technical Details
Message-ID: <3cbee37f_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!newsfeed.online.be!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!lsanca1-snf1!news.gtei.net!enterprise!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3cb9ef73$1_1@dnews> <MPG.172579c5bd0dc2ea98b534@newsgroups.borland.com> <3cbc80fd$1_2@dnews> <3cbc9afb_2@dnews> <3cbcdf8a_1@dnews> <3cbcf62f_1@dnews> <3cbe170c$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-18 08:36:23 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> <3cbc9afb_2@dnews> <3cbcdf8a_1@dnews> <3cbcf62f_1@dnews> <3cbe170c$1_2@dnews>
Subject: Re: how do I draw a JPG to a panel/container
Date: Thu, 18 Apr 2002 11:17:36 -0400
Lines: 30
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: <3cbee37f_2@dnews>
X-Trace: dnews 1019143039 24.29.81.241 (18 Apr 2002 08:17:19 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!newsfeed.online.be!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!lsanca1-snf1!news.gtei.net!enterprise!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews