Layout issues for GLCanvas in Box (HIV project)

Hi,

I’m doing a project to construct a 3D model of the HIV virus. This is a GLCanvas, displayed inside a (Swing) Box, inside a JFrame. I can’t seem to get it to cohabit nicely with the Box full of control buttons next to it.

Launch it via this page and see what I mean:

http://hiv.sourceforge.net/

The checkboxes keep vanishing or getting obscured.

Any advice? (All the source code is available through Sourceforge CVS, BTW.) - I’ve tried forcing some setSize()s whenever the window is resized but that doesn’t seem to help.

Thanks,
Dan

Try to get another heavyweight widget alongside your GLCanvas that can contain the other Swing widgets. The issue is probably that Java2D is attempting to claim part of your GLCanvas’s real estate for reneing of the Swing widgets. Alternatively, you could use a GLJPanel for better compatibility with Swing, though this will slow down performance considerably.

Thanks - I’ll try using a java.awt.Panel instead of a javax.swing.Box - sounds like an easy fix! Here goes…

Yep, that does it alright! Thanks

I have a similar problem, but my GLCanvas don’t display anything (yet it overlaps other UI’s components). If I use a GLJPanel it works, but painfully slow… :-[