Problems with Jogl applet

GC might have decided it were better to wait until cleanin up… you’ll have to profile this to be sure.

About repainting, I’m not sure about your update() method but I don’t have time to investigate…

Also, verify there isn’t any thread starvation (does your fps animator contains a Thread.sleep(…) ?) as starvation can cause repainting problems.

You could also println some info to get a better idea of the applet life cycle ( differences between stop() and destroy() for example : try your applet with firefox tabbed browsing and you will see a start/stop at each tab-switching).

Lilian

Have solved the update problem by using a regular Animator instead of an FPSAnimator and calling lupine.ui.repaint() in the applet’s paint method. Will post final code and a short step-by-step guide to making a (slightly more advanced than Gears) JOGL applet when I’ve figured out how to solve the page refreshing problem (tips for that are still appreciated).

Update:
This bug report appears to be exactly the problem I’m having, but according to the status it’s supposed to be fixed.
This is a workaround for the problem, but a really inelegant one.

Sequence of events:

applet init
(Lupine is instantiated)
(UI is instantiated)
loading UI (a singleton)
applet start
lupine init
(applet running, no new console output)
(user clicks reload)
applet stop
applet destroy
applet init
applet start
nullpointer exceptions when the singletons that should be loaded when loading the UI are accessed

While the bug is supposed to be fixed, the singletons are obviously not being reloaded :frowning:

Bah. Static variables seem to be nearly impossible to destroy. Does anyone know a way to force the program to load in a new ClassLoader (either in Java or with some javascript/html tricks on the page) or some other way to reload the whole thing from scratch?

Interesting bug I wasn’t aware of…

Too bad, you’ll have to create a kind of Global class and use it to store your singletons… or try and investigate singleton cleaning from the destroy() method (this should work at least).

Lilian :slight_smile: