Insert a GLAnimCanvas in a JScrollPane Swing

Hi !

I create a GUI for a scientific program. I have a GLAnimCanvas class in which I draw a pipe… My GUI is in Swing. I arrive to display my GLAnimCanvas in a JScrollPane but no correctly… The entire size of the GLAnimCanvas is always visible. I have a vertical scroll but when I move it, it recovers the rest of the GUI:


Menu

OpenGL GLAnimCanvas

status bar

the GLAnimCanvas will recover the menu and the status bar inspite of being hide by them…

I hope my explication is clear enough…
How could I do for having a correct crollbar ?

Thanks in advance for your help
Mat

Hi Mat,
I think this is really a java question. You are using a GLAnimCanvas, which is a heavyweight component (it extends Canvas), in a swing container which is lightweight. If you use the swing classes (e.g. GLAnimJPanel) provided in GL4Java it will probably fix your problem.

Jimmi

Hi jimmi and thanks for your reply…

in fact I tried with a JPanel and it did not work to, but it worked if I put my GLanimCanvas in an AWT scrollPane and not swing !

Mat

Originally posted by jimmi:
[b]Hi Mat,
I think this is really a java question. You are using a GLAnimCanvas, which is a heavyweight component (it extends Canvas), in a swing container which is lightweight. If you use the swing classes (e.g. GLAnimJPanel) provided in GL4Java it will probably fix your problem.

Jimmi

[/b]