Article View: borland.public.jbuilder.java.language
Article #17950Re: Problems with graphic context
From: Christoph Happich
Date: Thu, 03 Sep 1998 00:00
Date: Thu, 03 Sep 1998 00:00
73 lines
3302 bytes
3302 bytes
--------------C74AE4653E7857362F386242 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks. But this throws another questions: addNotify() ist called on an event. It's called with delay. Can it happen that my component is drawn with addNotify() uncalled? The frame should wait, because it needs this peer. And: Do you see why a created image needs a peer? Christoph Greg Hamer schrieb: > Your component needs to have its peer hooked up before you can get it to > create an image. the addNotify method is called when the peer has been > setup > so you can override this method, being sure to still call > super.addNotify() and create any images that you will be needing. > > Christoph Happich wrote: > > > Hi! > > I"m getting a NullPointer Exception just by adding this line to my > > component's constructor: > > createImage(1,1).getGraphics(); > > I think it's because the graphic context is not available in unvisible > > components. But, it should, because the context of the image has > > nothing to do with the component's context. > > I need that image for doube buffering. The buffer must be created > > BEFORE my component is drawn. > > Any ideas ? > > Christoph --------------C74AE4653E7857362F386242 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <HTML> Thanks. But this throws another questions: <BR><TT>addNotify()</TT> ist called on an event. It's called with delay. Can it happen that my component is drawn with <TT>addNotify()</TT> uncalled? The frame should wait, because it needs this peer. <BR>And: Do you see why a created image needs a peer? <BR>Christoph <P>Greg Hamer schrieb: <BLOCKQUOTE TYPE=CITE>Your component needs to have its peer hooked up before you can get it to <BR>create an image. the addNotify method is called when the peer has been <BR>setup <BR>so you can override this method, being sure to still call <BR>super.addNotify() and create any images that you will be needing. <P>Christoph Happich wrote: <P>> Hi! <BR>> I"m getting a NullPointer Exception just by adding this line to my <BR>> component's constructor: <BR>> createImage(1,1).getGraphics(); <BR>> I think it's because the graphic context is not available in unvisible <BR>> components. But, it should, because the context of the image has <BR>> nothing to do with the component's context. <BR>> I need that image for doube buffering. The buffer must be created <BR>> BEFORE my component is drawn. <BR>> Any ideas ? <BR>> Christoph</BLOCKQUOTE> </HTML> --------------C74AE4653E7857362F386242--
Technical Details
Message-ID:
<35EE5E63.6B77CF2B@techfa.uni-bielefeld.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35EDB43C.199BB68B@techfa.uni-bielefeld.de> <35EDF86F.7BAC882A@inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,c43cd982853305aa X-Google-Attributes: gidf74b3,public From: Christoph Happich <chappich@techfa.uni-bielefeld.de> Subject: Re: Problems with graphic context Date: 1998/09/03 Message-ID: <35EE5E63.6B77CF2B@techfa.uni-bielefeld.de> X-Deja-AN: 387427772 References: <35EDB43C.199BB68B@techfa.uni-bielefeld.de> <35EDF86F.7BAC882A@inprise.com> Content-Type: multipart/alternative; boundary="------------C74AE4653E7857362F386242" Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language