Re: J2ME MIDP1 CreateImage problem
From: Darryl L. Pierce (mcpierce_at_myrealbox.com)
Date: 07/17/04
- Next message: thufir.hawat_at_mail.com: "Re: what is a stack"
- Previous message: Darryl L. Pierce: "Re: J2ME MIDP1 CreateImage problem"
- In reply to: Steven J Sobol: "Re: J2ME MIDP1 CreateImage problem"
- Next in thread: Roedy Green: "Re: J2ME MIDP1 CreateImage problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Jul 2004 21:36:07 -0400
Steven J Sobol wrote:
> 2. There seems to be a scope issue. If I put the createImage calls in
> the constructor or the init() method, when paint() or another method tries
> to use the images in a call to drawImage, I get a null pointer exception.
> (This despite the fact that the Image objects are NOT set up using private
> variables; they're class members.)
>
> Putting the call to createImage inside the paint() method results in the
> images being drawn as they are supposed to be drawn.
>
> I've tried setting the class members containing the Image objects as
> private, protected and public; as static and non-static - and unless the
> createImage call exists within the paint() method and not in some other
> method, the midlet does not work.
It is *not* a scope issue. It is a clear bug in your code for creating your
instances of Image. Please post the full source code as is and I'll be glad
to help you with it.
-- Darryl L. Pierce <mcpierce@myrealbox.com> Visit the Infobahn Offramp - <http://mypage.org/mcpierce> "Lobby, lobby, lobby, lobby, lobby, lobby, lobby, lobby..."
- Next message: thufir.hawat_at_mail.com: "Re: what is a stack"
- Previous message: Darryl L. Pierce: "Re: J2ME MIDP1 CreateImage problem"
- In reply to: Steven J Sobol: "Re: J2ME MIDP1 CreateImage problem"
- Next in thread: Roedy Green: "Re: J2ME MIDP1 CreateImage problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|