Problems with OpenGL canvas in Swing

Started by bene_2808, August 31, 2015, 16:16:41

Previous topic - Next topic

bene_2808

Hello,

I have a big project with near to 10.000 lines of code, so I won't be able to post code to be understood simply... :-\
The project contains a GUI, the frame is implemented with JFrame consisted of a Canvas bound to the OpenGL context and several other Swing components.

First problem:
Sometimes the JSpinners and JTextField seem to receive mouse events, because the up and down arrows for incrementing or decrementing the number can be used, but seem NOT to receive keyboard events, because a change with the number keys is impossible in one situation and in the other everything works. I think, the Canvas could be the problem. What also could be important: My canvas class receives the events with the Mouse class in the input package and fires AWT Mouse Events automatically to make it possible to receive packaged mouse events from outside the canvas class, so that is behaves like a "normal" canvas. The keyboard events are not treated in that way, because they aren't needed, since not the canvas is supposed to get the events but the JSpinners in the same container.

Second Problem:
I use a JColorChooser which is opened in the case that the canvas is clicked, but is NOT treated by the OpenGL graphics thread, so the graphics won't slow down during executing a mouse listener method. But in some cases when the dialog is opened the whole application freezes. That's a reported bug (see https://bugs.openjdk.java.net/browse/JDK-6967484), but I think I found another site pointing out, that the bug has already been fixed, but the website now seems to be untraceable for me... If the problem was solved, could the canvas be the reason for the bug again?

Err, hope I could describe the problem  ::)
Thanks for your help  :)

bene_2808

Ok... After new experiments I found out that it isn't that intelligent to open the color dialog and do not stop the render thread while it is opened. After inserting code to pause the render process while the dialog is opened, everything works. So problem 2 is resolved. ::) ;D

But what about the first problem?   ???