PDA

View Full Version : 2 JGlCanvas on one panel



39smooth
03-22-2004, 04:43 AM
hi

i need to get two separate JGlCanvas to display on the same JFrame next to each other. I was originally adding just the one to the center of the JFrame. Now i want two i have decided to add a new Panel to the center of the JFrame and add the two canvases to the north and south of that. fine but it doesn't seem to want to add any canvas to the panel at all. it just shows up as a white screen. any ideas why? prob v simple, here my code from the JFrame.

Panel canvasPanel = new Panel();
myCanvas = new VmvGLCanvas(this);
canvasPanel.add(myCanvas, "Center");
add(canvasPanel, "Center");

if i change the last line to add myCanvas instead of the panel it works???

cheers