"No OpenGL context current on this thread" while calling gluSphere in glNewList

I get an Exception Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: No OpenGL context current on this thread

here’s the deal :

i get the identifiesr for my displayLists with :

   
public static void createLists(GL gl, GLU glu)
{
    MyGL.gl = gl; //here i store the current GL and GLU object
    MyGL.glu = glu;
    sphere = gl.glGenLists(1);
    alterLists();
}

then i create the lists with


public static void alterLists()
    {
        GLUquadric quadric = glu.gluNewQuadric();
        glu.gluQuadricTexture(quadric, true);
        glu.gluQuadricDrawStyle(quadric,GLU.GLU_FILL);
        glu.gluQuadricNormals(quadric, GLU.GLU_SMOOTH);
        glu.gluQuadricOrientation(quadric, GLU.GLU_OUTSIDE);

        gl.glNewList(sphere,GL.GL_COMPILE);
        glu.gluSphere(quadric,1,ballAtomComplexity,ballAtomComplexity);
    	gl.glEndList();
    }

and this works fine, but later i have a ruler to chage the complexity (stack and slice number) of my sphere. When the new value for ballAtomComplexity is set by this ruler, i call again the method alterLists(), and then i get the exception with the line glu.gluSphere …
I don’t understand, since the GLU object is the same (i stored it when create the display list IDs
i also tried to put a glu = new GLU(); but its the same
i have no problem with gl.xxxxxxxxxx methods

any hint ?

Thx

The OpenGL context is not current in your slider’s listener callback. You should update an instance variable in your slider’s callback and call display() on your GLCanvas to cause your GLEventListener to be called.

thx it works now