resizing glCanvas ~ unable to lock surface

As the title suggests, I have a problem here. I have a fairly large application now, and am trying to implement a changing canvas size. Don’t ask why, but it’s necessary.

I keep getting this error “Unable to lock surface”, and I have read ( in this forum in fact ) something about the canvas already being part of the frame being required. Also, that this problem is a bug in jogl, and is largely undocumented. Thus, I am rather in the dark here, and am looking for help. I can post code if required, but it’s simply a glcanvas that is placed in a JPanel, which is then placed into an extended JFrame.

And I am trying to resize the glCanvas by a button in the gui, so the app is already running.

help please!

thought I had solved the problem by changing setSize() to resize(), but no, it is still there. I also get a swapBuffer exception, but I read that is quite common on these forums. However, the lock surface is crashing my program, so any ideas would be really helpul.

problem solved - it has to be attached to a visible frame before you modify it… I was removing it then trying to edit it, however it was therefore not visible. Solution : don’t remove it. Just resize it, and modify the rest of the frame as required. Thanks for reading.

I think that fact that an exception is thrown if the GLCanvas is removed from its parent and then resized via the API should be considered a bug. Could you please create a small test case and file a bug with the JOGL Issue Tracker on the JOGL home page?