Java3D Tips

Last update of this Page:


Contents



How to use the Swing menu with Java3D?

Swing components are usually light weight components. But Canvas3D is a heavy weight component. The order of component drawing is : first light weight one and then heavy weight one. So, if the JMenuItem etc. can not draw over the Canvas3D. You just can not see the menu. Or if the pop up menu size is over the application window size, you can see the pop up menu.

To solve this problem, you should declare the Swing component should be heavy weight. One way of this is using setDefaultLightWeightPopupEnabled() method. For example, write next code before you new the MenuItem component. Java3D demo includes some JComboBox examples.

    JPopupMenu.setDefaultLightWeightPopupEnabled(false);

Picking

From Java3D 1.2 to 1.3

com.sun.j3d.utils.behaviors.picking.PickRotateBehavior is just replaced by import com.sun.j3d.utils.picking.behaviors.PickRotateBehavior. Some methods seems changed, but, just replacing them is usually works, like next:
  // import com.sun.j3d.utils.behaviors.picking.*;
  import com.sun.j3d.utils.picking.behaviors.*

How to chenge the press button.

Try to change PickTranslateBehavior will wake up with left mouse button.

Cripping distance.


Copyright (C) 2000-2003 YAMAUCHI Hitoshi
Most recent update : :