hello my question is not a full jpct question but maybe...
I have a JPCT application with a panel showing a AWTGLCanvas and next to it a JEditorPane...
When clicking on some object in my JPCT panel, i ask the JEditorPane to load different HTML Page at different url... It works fine 1 time, 2 times... and then i have this exception. I tried to look at LWJGL doc but i m not familiar. I don t fully undertand every processes acting when i do such operation... So, if anybody has an idea on how to deal with it, i would greatly appreciate....
here is the exception
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: From thread Thread[AWT-EventQueue-0,6,main]: Thread[AWT-EventQueue-0,6,] already has the
context current
at org.lwjgl.opengl.Context.checkAccess(Context.java:165)
at org.lwjgl.opengl.Context.makeCurrent(Context.java:172)
at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:230)
at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:248)
at sun.awt.RepaintArea.updateComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
and here is the code of my picking method
public void pickingObject(int mouseX, int mouseY){
SimpleVector ray=Interact2D.reproject2D3D(camera, buffer, mouseX, mouseY);
int[] res=Interact2D.pickPolygon(theWorld.getVisibilityList(), ray);
if (res!=null) {
Object3D pickedObj=theWorld.getObject(Interact2D.getObjectID(res));
urlIndex++;
theFrame.getMyHTMLPane().loadURL(urls[urlIndex%3]);
}
}
loadURL method is a call to the setPage(String s) method of JEditorPane
Thanks
Manu