Areas
  • J3D FAQ
  • Tutorials
  • Utilities
  • Books
  • News
  • Other Sites
  • FAQ Topics
  • Introduction to Java 3D
  • Documentation
  • Speed issues
  • Running Java 3D
  • Object manipulation
  • Scene appearance
  • Java 3D and Swing
  • Image capturing
  • Stereo viewing
  • Input Devices
  • Textures
  • Web browsers
  • Video Hardware
  • VRML
  •   

    Java 3D and Swing

    1. Using Java 3D and Swing together

    Return to the main FAQ page for more questions and answers.

      

    1. Using Java 3D and Swing together

    The reason you're seeing this is that Java 3D uses some heavyweight components and Swing uses lightweight components. There is a nice discussion of how do deal with this in an article called Mixing Heavy and Light Components .

    JDK 1.2 beta 4 and Java 3D 1.1 Beta 1 also corrected a problem in which Swing threads and Java 3D threads interfered with each other. If you've had problems with Swing and Java 3D in the past, you might want to test your programs with the latest release of Java 3D.

    To use a JMenuBar, you must call

            JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    
    so that the menu will draw on top of the Canvas3D object.

    To use Tooltips, you must call both of the following:

            JPopupMenu.setDefaultLightWeightPopupEnabled(false);
            ToolTipManager.sharedInstance().setDefaultLightWeightPopupEnabled(false);
    

    JInternalFrames don't work correctly; this may be resolved in the future.

    If you want to use a Canvas3D object inside a scrolling pane, use the AWT ScrollPane instead of JScrollPane.

    Back to top

      

    [ Copyright Info ] [ FAQ Home ] [ J3D.org Home ] [ Tutorials ] [ Utilities ] [ Books ] [ Contact Us ]