JOGL applet on OSX

This looks similar to the issue I asked about with a Swing application, except this is an applet and not Swing.

We’re using OSX 10.2, and Java 1.4.1.

The following applet (included are my HTML file and the java file–you may have to fiddle with the HTML to get it to work) works on Windows, but JOGL fills the whole applet (not just its own part) and draws the picture at the bottom of the applet on OSX.

Is this the Apple problem I’ve seen mentioned before? Gregory sometimes mentions a known bug–is this it?

The HTML:


<HTML>
<HEAD>   

<TITLE>JOGL Applet Test</TITLE>

</HEAD>
<BODY>

<H3><HR WIDTH="400" ALIGN=LEFT>JOGL Applet<HR WIDTH="400" ALIGN=LEFT></H3>
<P>

<APPLET code="JOGLApplet.class" width=400 height=600>
</APPLET>
</P>
<HR WIDTH="400" ALIGN=LEFT>
</BODY>
</HTML>

The applet:


import net.java.games.jogl.*;

import java.awt.Button;
//import java.awt.event.AdjustmentEvent;

public class JOGLApplet extends java.applet.Applet implements GLEventListener {
    
    private Button button = new Button();
    
    public void init () {
        System.err.println("In init()");
        setLayout (null);
        setBackground (java.awt.Color.white);

        GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());        
        canvas.addGLEventListener(this);
        canvas.setBounds (20, 20, 350, 340);
        add(canvas);
        System.err.println("added canvas");

        add(button);
        button.setLabel("Hi there");
        button.setLocation (20, 370);
        button.setSize(button.getPreferredSize ());
    }
    public void init(GLDrawable drawable) {}
    
    public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
    
    public void reshape(GLDrawable drawable, int x, int y, int width, int height) {}


    public void display(GLDrawable drawable) {
        System.err.println("In display()");
        GLCanvas canvas = (GLCanvas) drawable;
    
        GL gl = canvas.getGL();
        
        gl.glClearColor(0.f,0.5f,1.f,1.f);
        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
            
        gl.glPushMatrix();
        gl.glOrtho(-1.f,1.f,-1.f,1.f,-1.f,1.f);
        
        gl.glColor3f(1.0f, 1.0f, 0.0f);
        gl.glBegin(GL.GL_TRIANGLES);
        float _x = 0.0f, _y = 0.0f;
        gl.glVertex3f(_x + -0.5f, _y + -0.5f, 0.0f);
        gl.glVertex3f(_x +  0.5f, _y + -0.5f, 0.0f);
        gl.glVertex3f(_x +  0.0f, _y +  0.5f, 0.0f);
        gl.glEnd();
        
        gl.glPopMatrix();
    }
}

thanks
andy

No thoughts on this?

andy