I'm trying to get SWT working with the newest JOGL (2.0).

I tried [SWT snippet 209](http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet209.java?view=markup), but it doesn't work. The problem is caused by the following line:

```
final GLContext context = GLDrawableFactory.getFactory().createExternalGLContext();

```

...but when I change `getFactory()` to `getFactory(GLProfile.getDefault())` (to make it compatible with the new API), it crashes on `createExternalGLContext()` with `javax.media.opengl.GLException: Error: current context null`. I don't understand this message: I'm trying to create a new context, and it complains that the current is null. Why?

Maybe there is some other way to create a `GLContext`?

Or maybe it is possible to use `GLEventListener` with SWT `GLCanvas`?

PS. I placed my modified version of the snippet [here](http://m01.pastebin.com/1JW3CCxi).

---

Edit: now I understand the error message. [Documentation](http://jogamp.org/deployment/jogl-next/javadoc_public/javax/media/opengl/GLDrawableFactory.html#createExternalGLContext%28%29) says:

> 
> The underlying OpenGL context must be current on the current thread at the time this method is called.
> 
> 
> 

How to create the first `GLContext`?