Re: problem with DisplayPanelJ3D

Hi Vladimir,

> Hello, I have some trouble when adding a DisplayPanelJ3D in a
> JInternalFrame.
> Actually, the DisplayPanelJ3D hiddes every other DesktopPane's
> JInternalFrame, and
> even every component of my main Frame!.
> I have tried to modify the layer of the JInternalFrame containing the
> DisplayPanelJ3D, but it doesn't work.
> When using a DisplayPanelJ2D I don't have this kind of problem, why?

This is a well-known problem with Java3D (DisplayPanelJ3D
uses the Java3D graphics API, whereas DisplayPanelJ2D uses
Java2D).  Java3D is implemented using OpenGL (or Direct3D)
which can utilize 3-D graphics hardware.  In order for the
graphics hardware to deal with window occlusion properly,
it must render into a native window of either X Windows or
M$ Windows.  Thus the Java3D renders into a Canvas3D (extended
to VisADCanvasJ3D inside the DisplayPanelJ3D) which
corr4esponds to a native window.  Many of the swing components
do not have a native window - they are called lightweight and
Java Swing manages their window occlusion.  Since they do not
have native windows, the 3-D graphics hardware doesn't even
know they exist and ignores them in window occlusion
computations.  This has been discussed many times on the
java3d-interest@xxxxxxxxxxxx mailing list, and there won't
be a clean solution anytime soon.

The work-around is to use heavyweight components for everything.
The VisAD SpreadSheet is an excellent example of a GUI that works
well with Java3D.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738