PDA

View Full Version : Insert a GLAnimCanvas in a JScrollPane Swing



Mat
04-18-2002, 07:14 AM
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

jimmi
04-19-2002, 12:36 AM
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

Mat
04-19-2002, 05:50 AM
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:
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