Canvas3D seems to always keep itself on top, so
that drop down menus (and other GUI components) always fall behind it. Is there
any way to get the Canvas3D to honor the layering of other components?
Here's a piece of my code. The internal frame that
the Canvas3D is placed in works fine, and it's own boundary get's covered by the
menu drop downs, but, not the Canvas3D itself.
public class MainDesktop extends JDesktopPane {
private MainDesktop()
{
...
addViewFrame();
}
...
addViewFrame();
}
...
private void addViewFrame() {
JInternalFrame viewFrame = new JInternalFrame();
viewFrame.setBounds(VIEW_LEFT, VIEW_TOP, VIEW_WIDTH, VIEW_HEIGHT);
viewFrame.setNormalBounds(viewFrame.getBounds());
viewFrame.setVisible(true);
this.add(viewFrame, JLayeredPane.DEFAULT_LAYER);
// If do the following before viewFrame is added to the JDesktopPanel,
// adding to the JDesktopPanel fails. Cannot load the Canvas3D.
java.awt.Container cp = viewFrame.getContentPane();
cp.setLayout(new BorderLayout());
cp.add(ViewCanvas.getReference(), BorderLayout.CENTER);
}
...
}
private void addViewFrame() {
JInternalFrame viewFrame = new JInternalFrame();
viewFrame.setBounds(VIEW_LEFT, VIEW_TOP, VIEW_WIDTH, VIEW_HEIGHT);
viewFrame.setNormalBounds(viewFrame.getBounds());
viewFrame.setVisible(true);
this.add(viewFrame, JLayeredPane.DEFAULT_LAYER);
// If do the following before viewFrame is added to the JDesktopPanel,
// adding to the JDesktopPanel fails. Cannot load the Canvas3D.
java.awt.Container cp = viewFrame.getContentPane();
cp.setLayout(new BorderLayout());
cp.add(ViewCanvas.getReference(), BorderLayout.CENTER);
}
...
}
