I have a program runing JOGL with multiple JFrames with GLCanvases on them. I want to take a screenshot from one of those panels in response to a GUI event. The problem is that the event dispatch thread is not apparently the right thread to be calling from - I get this exception:
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: No OpenGL context current on this thread
I suppose this should have been obvious, but at this point, I’m not sure how to proceed - does anyone have a clever way of getting around this? My first thought is to set a state flag that tells the screenshot to be taken on the next repaint, but the model I’m using for this application would require some significant changes to do that… any other ideas?