views:

436

answers:

1

My jogl applet screen is blank. I have this for my paint code:

 public void paint(Graphics g){
        canvas.update(g);
    }

if I add g.fillRect(0,0,50,50); to it it'll draw the filled rect, but still not the jogl stuff.

+1  A: 

I'm not exactly clear what the rest of your program looks like. However you should be aware that JOGL components don't draw like other components; in other words if this code is on an instance of GLAutoDrawable (i.e. GLJPanel or GLCanvas) then it won't do anything useful.

What you need to do is create a GLEventListener and attach it to the GLAutoDrawable. Then you need to implement display (GLDrawable drawable) with code that draws your 3D scene.

This tutorial is useful in getting you started.

DJClayworth