Author Topic: Null Pointer in FrameBuffer while running as JApplet  (Read 2352 times)

Ray Tucson

  • Guest
Null Pointer in FrameBuffer while running as JApplet
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Null Pointer in FrameBuffer while running as JApplet
« Reply #1 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.

Ray Tucson

  • Guest
Null Pointer
« Reply #2 on: July 26, 2004, 09:50:44 pm »
Thanks, that was the hint I needed.