Forcing Swing components to redraw is a performance killer

My application mixes Swing components and a GLCanvas. The user is also able to open new dialogs also using Swing components and some GLCanvas for preview.

At home on my Athlon 64@3200 + GeForce 6600 + 1Mb of RAM there is no problem, everything is ok. ( FPSAnimator @60hz )

On other computers Swing components are not always refreshed and some dialogs just show a single slider. ( If I set the FPSAnimator @ 5hz, everything is ok but my game is not playable ).
This is not acceptable so I have tried to add a add( JComponent ) method to the Animator class. Now, for my main window, the FPSAnimator have to repaint 2 JPanel containing some JButton and a GLCanvas. Performances are down so I can’t do the job this way.

Have you a better solution for my problem ?

What OS are you running on?

If you’re running on Windows, the repainting issues sound like DirectDraw/OpenGL conflicts. Are you running with the system property -Dsun.java2d.noddraw=true (required for all JOGL apps running on Windows)?

I’ve encountered that kind of repaint problem with VLDocking on linux.

The workaround was to patch the Animator with a small sleep() in the rendering loop (repaint starvation ?)

Lilian

The application has been tested on Windows XP with the option -Dsun.java2d.noddraw=true

I’ll try the sleep() in the rendering loop then I’ll tell you.