Hi Hartmut,
DisplayImplJ3D is an extension of Java3D's Canvas3D, which is a heavyweight
component. JComboBox, along with all Swing components, is lightweight,
causing the JComboBox to appear underneath the DisplayImplJ3D.
You can solve some problems by calling
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
Unfortunately, this call does not solve all problems of this type. My
suggestion is to avoid overlapping these types of components wherever
possible. You could move your small JPanel from BorderLayout.NORTH to
BorderLayout.SOUTH, thus avoiding your current problem.
Also, if I recall correctly, there is an additional problem with JComboBoxes
and DisplayImpls. If your JComboBox selection alters the DisplayImpl such
that it needs to re-render, and the JComboBox drops down over the DisplayImpl,
you might see some very strange behavior in the DisplayImpl. I think this
problem is a thread issue with JComboBox. It might be fixed in JDK 1.3
releases, but I'd avoid letting a JComboBox overlap a DisplayImpl anyway.
For more information about mixing heavyweight and lightweight components,
see: http://java.sun.com/products/jfc/tsc/articles/mixing/index.html
-Curtis
At 10:33 05-07-00 -0400, you wrote:
>Hello group,
>
>I have a problem with DisplayImplJ3D. In my application, one larger JPanel
>contains one small JPanel (pnl_top) with some Swing controls in it (placed
>with BorderLayout.NORTH in the large JPanel) and another JPanel
>(pnl_display) with the DisplayImplJ3D in it (placed with BorderLayout.CENTER).
>
>When I click on one of the JComboBoxes in pnl_top, the list of items does
>not show up as expected, but is hidden under the black background of
>pnl_display.
>
>I have a very similar design of panels with a DisplayImplJ2D, and there the
>combo boxes work fine (the list of items shows up on top of the background
>of pnl_display).
>
>I am using Win NT, a very recent download of VisAD, jdk1.2.2, and Java3D
>1.1.3.
>
>
>Any hints?
>
>
>Thanks a lot in advance,
>Hartmut
>
>
>
>
>
>Hartmut Frenzel
>Oak Ridge National Laboratory
>Computer Science and Mathematics Division
>Phone: (865) 241-0874
>Fax: (865) 241-2850
>E-mail: frenzelh@xxxxxxxx