swing problem with 1.1b12 ?

hi all

i work under linux , and before today i had jogl 1.1b04, with no major problem

since i’m using 1.1b12 i have a swing problem, my JButton JMenu JMenuItem… text isn’t displayed unless i click on it

i use the line :
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
but it doesn’t seems to correct the porblem (which i find normal, since it’s not a weihgt problem)

here’s a snap shot of the problem
http://thomas.ludwig.free.fr/snap.png

thx

I had this trouble as well.

It stems from the fact that jogl’s threading model changed (in b10 i believe) so that all rendering is done synchronously on the AWT event thread. This is also where swing rendering is done, so there is scope for starvation of swing drawing.

I solved it by implementing my own Animator class, that simply calls GLDrawable.display() repeatedly, but with a Thread.sleep( 1 ) between each call.

thanks, i’ll check if i want to use my own animator or simply stay in my old version of jogl

Yes, it does look like the built-in Animator class has starvation problems on Linux because it swamps the CPU. Try adding a Thread.yield() or Thread.sleep(1) at the bottom of your GLEventListener.display() method. Please try to upgrade as the more recent version should be more stable in all other respects.

[quote=“Ken Russell,post:4,topic:23772”]
I’ve not tested it, but would this actually help?

Since the display() method is executing on the AWT event thread, putting the sleep() call inside won’t make any difference to the starvation. At least, AFAICS ???

This trick has cleared up starvation problems I’ve seen on some Linux distributions. It’s used in a couple of the JOGL demos. Try it and see.

I’ve used it successfully (but my yield() was in the animator’s loop, not in the listener’s display(); i didn’t try the other way ).

Lilian