Hey guys,
i’m using the canvas as the viewport. Yesterday i’ve tried to add the canvas to a jsplitpane, but resizing doesn’t work. Is there a workaround for this problem?
To reproduce this problem only try the following in your TestCanvas class:
[java]public static void main(String[] args){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
createFrame();
createCanvas(appClass);
JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitter.setLeftComponent(canvas);
splitter.setRightComponent(new JLabel(“Test”));
frame.getContentPane().add(splitter);
frame.pack();
startApp();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}[/java]
Regards
Moe
Set a minimum size to the parent container to avoid that:
[java]oGLPanel.setMinimumSize(new java.awt.Dimension(10, 10));[/java]
Thank you - works