Again JOGL and Swing

Hi,

I’m using a GLCanvas within a pretty complex Swing-GUI which works so far even in a JTabbedPane.
To display the scene I use the Animator-class, i.e. it loops forever with max. performance. The problem
is, that is seems to me that the Swing repaint-thread doesn’t get enough time to repaint the components if
necessary. E.g. if I click a JComboBox to open the option list, the combobox isn’t repainted so I can’t
see the option list. The same with popup menues (over a ligthweight component) or if I resize the window.
I’ve tried to insert a Thread.sleep() in my display()-method. Now the Swing stuff is repainted fine but it drops
down my fps-rate. Any hints how to get max. fps-rate but also getting Swing repainted correctly?

Thanks,
gerd

Try copying the Animator class and adding a Thread.sleep() call in its animation loop rather than in your display() method, which will stall the AWT EventQueue thread. If that doesn’t help, try calling GLCanvas.repaint() at the bottom of your display() method rather than using the Animator. I think that will let the AWT schedule events more flexibly than the Animator allows.

Thank you for the hint. A Thread.yield() in the Animator-loop does the trick too.
Swing runs much smoother now.

bye,
gerd