www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Ray Tucson on July 26, 2004, 05:42:32 pm

Title: Null Pointer in FrameBuffer while running as JApplet
Post by: Ray Tucson on July 26, 2004, 05:42:32 pm
The assignment has been given to me to port an existing JPCT JFrame application to a JApplet.  My problem is I am getting a NullPointerException within the FrameBuffer class without any hint as to the cause.  The stack trace is as follows:

-> support for BufferedImage
-> using BufferedImage
Software renderer (legacy mode) initialized
Software renderer disposed
Software renderer (OpenGL mode) initialized
1801-2053 -> using splitted buffer access!
java.lang.NullPointerException
   at com.threed.jpct.FrameBuffer.display(Unknown Source)
   at com.threed.jpct.FrameBuffer.display(Unknown Source)
   at com.threed.jpct.FrameBuffer.display(Unknown Source)

I am still developing the Applet in Eclipse so I'm not trying to load resources from a JAR and the Applet has AllPermissions in its security policy.  So, for all purposes, the program is still running as a standalone application except that the top level container has been changed from a JFrame to a JApplet.

Can someone please lead me in the right direction here.
Thanks in Advance, Ray
Title: Null Pointer in FrameBuffer while running as JApplet
Post by: EgonOlsen on July 26, 2004, 06:54:36 pm
Looks like as if the Graphics-instance you are using is null. Check this before calling display(Graphics,....) to see if it's the case. There's not much more in display() that could be null.
Title: Null Pointer
Post by: Ray Tucson on July 26, 2004, 09:50:44 pm
Thanks, that was the hint I needed.