Swing and Jogl...

Hi.
I have a problem opening a new JFrame while my Application is running. To be exact i want to open a new JFrame with a JTable after an object has been selected (picked).
Although i use InvokeLater the jTable isn’t shown correctly. After creating the JFrame I don’t change anything in the JFrame.
If i click inside the JFrame some parts of the table show up and if i resize it seems that the table isn’t “refreshed” until i click inside the Jframe (again some parts of the jtable are shown correct…).
I tried to open the Jframe in the main method. The result was that the Jframe looked correct until my canvas(in an awt Frame) was initialized and got the focus. After that it looked exactly like I described above.
If I just open the JFrame with swing code outside of my application there seems to be no problem, everything looks correct and is resizeable.

Im running my app on Linux with jogl v1.1b12.

Sorry for my english :slight_smile: I hope someone has understood and can help me. Thanks in advance.

Are you using an Animator in your application? The Animator by default uses 100% of the CPU and I’ve seen thread starvation problems on Linux where the fact that it is continually redrawing the GLCanvas causes other Swing widgets to not be redrawn. Have you tried writing your own redraw loop and putting in a Thread.yield(), or not using an Animator at all and just using repaints to redraw your application, depending on how you need redraws to occur?

I’m using an animator, because its a realtime application and i need the constant redraw (as often as possible). So i haven’t written my own animator, since i had no problems yet.
So your suggestion is to write my own animator class which calls the display method directly and put a sleep (or yield) at the end ?
I’m not that experienced with all the jogl stuff, is there an example for a custom animator in some jogl Demos maybe, where i can get some inspiration? :slight_smile:

Thanks in advance.
BK

You can just copy the sources for the Animator class for a start. You’ll need to delete the reference to the method willSetRenderingThread.

Thanks for your help. The swing components show up and there seem to be no problems any more.

BK