Can't find method in jogl 2.0

In book Pro Java 6 3D Game Development: Java 3D, JOGL, JInput and JOAL to obtain GLDrawable following code is used:

drawable = GLDrawableFactory.getFactory().getGLDrawable(this, caps, null);

sadly its not work anymore, i tried change it to:

drawable = GLDrawableFactory.getFactory(GLProfile.get(GLProfile.GL2)).getGLDrawable(this, caps, null);

but it seems like GLDrawableFactory doesn’t have getGLDrawable method anymore. It have createGLDrawable that takes different argument but im not sure if its equal to getGLDrawable. Can anyone help me?

yes createGLDrawable should be similar to the old getGLDrawable.

when all you want is just to create a canvas this is all you need:

//create a profile, in this case OpenGL x <=3.0
GLProfile profile = GLProfile.get(GLProfile.GL2);

//configure context
GLCapabilities capabilities = new GLCapabilities(profile);
capabilities.setNumSamples(2); // enable anti aliasing - just as a example
capabilities.setSampleBuffers(true);

//initialize a GLDrawable of your choice
GLCanvas canvas = new GLCanvas(capabilities);

//register GLEventListener
canvas.addGLEventListener(...);
//... (start rendering thread -> start rendering...)

Yea i know that. But i need to use it without GLCanvas, just with regular canvas from awt. This drawable is used in Active Rendering thread.