[quote]Is it possible to make a GLCanvas live inside an awt Panel or swing JPanel? I am porting gl4java code which has a GLCanvas inside a JPanel. When I try to do the same with jogl, the GLCanvas takes up the entire Frame. I have found no way to limit the size of a GLCanvas to less than the entire Frame.
[/quote]
Well, I’ve not tried yet to put a GLCanvas inside a Panel, however if you “just” wish to limit the size of your GLCanvas to less than the entire Frame, then I’ve already used this and it works fine.
Let’s assume that the current “this” class is a (AWT) Frame. (Also I’ll mix AWT and SWING with the usual restrictions like overlapping of such components will provide problems etc.)
// Constuctor of this Frame class
GLCanvas can = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
JPanel pan = new JPanel();
JLabel lab = new JLabel("bla");
pan.setPreferredSize(new Dimension(64, 400)); // height doesn't matter.
add(can, BorderLayout.CENTER);
add(pan, BorderLayout.EAST);
add(lab, BorderLayout.SOUTH);
show();
Maybe this helps?
If it doesn’t work there’s some strange difference between my used Jogl for Win32 (downloaded from the file sharing area in the Jogl project, with 2nd July) and your Jogl for Macos…