Using a JME Canvas inside a JScrollPane

Hi!



I tried to change the class RenPArticleEditor (from package jmetest.effects) in order to have the canvas inside a JScrollPane. When I move it with the scroll bar the canvas is drawn above the frame and I don’t have a clue about why that happens.



You can see what I’m talking about in the next image:







I hope someone can help me as you always do. Thank you!


is this because a heavyweight component will always draw over a lightweight component?

awt/jme canvas being heavyweight, swing being lightweight.



http://www.jmonkeyengine.com/jmeforum/index.php?topic=6926.0

Core-Dump said:

is this because a heavyweight component will always draw over a lightweight component?
awt/jme canvas being heavyweight, swing being lightweight.

http://www.jmonkeyengine.com/jmeforum/index.php?topic=6926.0


I've read the thread and I can't see how to solve my problem. I've also tried with the setZOrder method and It doen't work. Anyway, thank you!.

Any other help?

jmecanvas is not capable of being inside of a jscrollpanel as they are natively tied to opengl and the system decides how to draw them.

But you can use two JScrollBars and translate the view yourself.