How to do realtime rendering in SWING application?

Hi.
I’m sorry if there are similar topics but I have problems with programing realtime OpenGL application in Java using swing components (like JSplitPane) I want to render to the some resizable part of window and to add some controls around and maybe use more viewports in the future. I’m trying different ways for two days and no one is successfull :frowning:

The ways I tried:

  • GLCanvas works fast and well but cannot be used on swing components like JSplitPane, so it’s not usable
  • GLJPane is too slow (about 15FPS for fullscreen) and consumes lot of CPU time … known issue but not mentioned in simple demos
  • using -Dsun.java2d.opengl=True is not posible for some JRE/HW/OS/driver? combinations … I’m not the lucky one. Bug is reported there http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6723523. I’m using Vista SP1 and NVidia 8600GT and tried to upgrade to latest drivers and JDK.

GLCanvas Just Works for me: see http://www.xinaesthetic.net/

It does mean that it intergrates slightly less well with the rest of swing; namely, overlapping components don’t get displayed properly. The ap on my website just basically avoids dealing with that. This is better than the chronic slowness of GLJPanel though, which is taking a screenshot of every frame and copying it back into memory as a BufferedImage as far as I remember. I tried using that for the smaller views on the right, which only display on interaction, with somewhat variable results in terms of performance. I haven’t tried much with the OpenGL Swing pipeline, hopefully that will make it all work well sometime.