Mixing GLCanvas and jScrollPane

Posted by sylvestre on
URL: https://forum.jogamp.org/Mixing-GLCanvas-and-jScrollPane-tp4008270.html

Hello,

Using JOGL 2, I have a problem with using a GLCanvas into a JScrollPane.
As you can see in the Incorrect.png [1] screenshot, the graphic is not correctly positioned. Correct.png [2] shows what I should get.

The current SWIG tree is:
JFrame
   - JPanel (BorderLayout)
     - JTextArea (BorderLayout.NORTH)
     - JScrollPane (BorderLayout.CENTER)
       - GLCanvas.

I know that mixing AWT (GLCanvas) with SWING is not easy but it is now well supported by recent JVM versions. I am using GLCanvas to get better performances.

Any idea?

Thanks
Sylvestre
[1] Correct:

[2] Incorrect: