GlEventListener initialization
Posted by John No on Jun 16, 2014; 12:13pm
URL: https://forum.jogamp.org/GlEventListener-initialization-tp4032434.html
Hi,
i am currently writing a small visualization plugin for an existing software and have encountered a problem with the initialization of the GEventListener.
The software uses JPanels as container for forms and the GLCanvas of my plugin is added directly to one of these JPanels. In the GLCanvas contructor i'm adding my GLEventListener.
Now, when i open the form for the first time everything works as expected (init is called). When a form is closed the JPanel gets removed from the window, but it is cached in a map datastructure in case the user reenters the form later. This is where the problems start. When the GLCanvas is removed from the visible component hierarchy, the dispose method of the GLEventListener gets called. However, when i reenter the form (parent JPanel is displayable again) it does not call its init method.
The interesting thing is, if i now close and reenter the form again the GLEventListener calls init as expected. It works every second time i enter the form.
Is there a dispose procedure that i should keep to get it working every time? (Currently the dispose method of my GLEventListener doesn't contain anything joglrelated.)
Thanks,
John
Btw, thanks for maintaining the incredibly useful Jogl project.