Article View: borland.public.jbuilder.java.language
Article #17777Re: Doubble buffering in a canvas.
From: Hando
Date: Thu, 01 Oct 1998 00:00
Date: Thu, 01 Oct 1998 00:00
49 lines
2643 bytes
2643 bytes
I'll forward your answers to faq maintainer for a response. I wasn't really trying to recomend one way or another, just bringing a different opinion into view. Cheers, Stuart John P. McGrath wrote: > > Hando <hando@tig.com.au> wrote: > > > From the Java programmers FAQ http://www.afu.com/javafaq.html > > > Javasoft recommends against explicit calling (and, presumably > > overriding also) of addNotify() by applications programmers - > > this is especially important in these days of Lightweight > > components that do not have peers. If you have any code that > > requires peer resources, move it into a thread that is started > > from a conditional branch of the paint() or update() method. > > I have seen recommendations that application code not directly > call addNotify(), although I have seen exactly this technique > presented in "Core Java Foundation Classes". This series of Java > books is certainly regarded as one of the best Java book series. > > I have never before seen anyone suggest that addNotify() should > not be overridden, and I am not sure why the FAQ author would > presume that Javasoft recommends against it. > > But I have seen this done countless times. Because many of the > resources associated with a component are not available until the > peer is created, this is, as far as I know, the best place to > perform certain operations. If you have a better recommendation > as to where to do this, please post a message describing it. > > Also, the FAQ you quoted seems to suggest that Lightweight > components do not a peer, and thus addNotify() will not be > called. Actually, lightweight components do have a peer, but it > is an instance of java.awt.LightweightPeer. And addNotify() does > get called for lightweight components, just as for heavyweight > ones. > > -- > Regards, > > John P. McGrath > <mcgrath@enter.net> > <jpm@nscs.fast.net>
Technical Details
Message-ID:
<3612CAE5.ECDBA545@tig.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6ttqkl$ao64@forums.borland.com> <MPG.106ea95b22eab1c59896b3@forums.inprise.com> <3609A85C.E6B7F98E@tig.com.au> <MPG.1077d6b0ae5083189896bd@forums.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a7d917cc0ce6dd31 X-Google-Attributes: gidf74b3,public From: Hando <hando@tig.com.au> Subject: Re: Doubble buffering in a canvas. Date: 1998/10/01 Message-ID: <3612CAE5.ECDBA545@tig.com.au> X-Deja-AN: 396520688 Content-Transfer-Encoding: 7bit References: <6ttqkl$ao64@forums.borland.com> <MPG.106ea95b22eab1c59896b3@forums.inprise.com> <3609A85C.E6B7F98E@tig.com.au> <MPG.1077d6b0ae5083189896bd@forums.inprise.com> To: "John P. McGrath" <mcgrath@enter.net> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language