I didn't say I don't agree, just not 100%.... And I totally agree on what u said in
this mail.
The workaround I use is the BorderLayout and add Swing components to the left or
right. That
way, you may avoid some unwanted interference....
Vladimir Olenin wrote:
> Couldn't run it: the sources contain references to other classes
> (looks like u r an MFC keener :) ). But i didn't say that such application
> wouldn't work, but just that all heavyweight comps are displayed atop of
> the lightweight ones. That is u wouldn't get any error message or the
> like, since it is not a mistake to add a heavyweight comp to a
> lightweight panel. The deal is that Canvas3D would be displayed ATOP
> the container it had been added to and atop any lightweight comps that
> have been added to a, let say, JPanel AFTER the Canvas3D. That's why i
> guess lightweight Swing menus can't be displayed in the area where
> Canvas3D is positioned, while if u would use standard AWT menus, u'll
> see it no problem.
>
> Possibly i just got your problem wrong.
> vladimir
> -=V=-
> >-------<=============>-------<
> Join in Java community now!
> http://JavaCafe.VirtualAve.net/
> >-------<=============>-------<
>
> In your previous letter u wrote:
> --------------------------------
> DT> I don't subscribe 100% at this....
> DT> Take a look at the two files attached, this is a portion of an application I
>wrote that
> DT> really works.
>
> DT> Vladimir Olenin wrote:
>
> >> I guess u ran across the same notorious issue: heavyweight components
> >> vs. lightweight ones. The latter are always overlapped by the former,
> >> no matter what the Z order is. Canvas3D is a heavyweight comp, while
> >> all Swing components are the light ones.
> >>
> >> I guess that's where your problem is.
> >>
> >> vladimir
> >> -=V=-
> >> >-------<=============>-------<
> >> Join in Java community now!
> >> http://JavaCafe.VirtualAve.net/
> >> >-------<=============>-------<
> >>
> >> In your previous letter u wrote:
> >> --------------------------------
> >> SS> Hello,
> >>
> >> SS> Attached is a short program that should (as far as I know) implement
> >> SS> a java3d window as a JPanel. However, it does not.
> >> SS> Any suggestions.
> >>
> >> SS> Steve
> >>
> >> SS> //////////////////////////////////////////////////////////////
> >> SS> //////////////////////////////////////////////////////////////
> >> SS> import java.awt.*;
> >> SS> import java.awt.event.*;
> >> SS> import java.awt.event.WindowAdapter;
> >> SS> import javax.swing.*;
> >> SS> import javax.swing.JFrame;
> >>
> >> SS> public class MethodView extends JFrame {
> >>
> >> SS> Container contentpane;
> >> SS> protected JPanel ivjJPanel1 = null;
> >>
> >> SS> MethodNode MethodRoot = new MethodNode();
> >>
> >> SS> public MethodView(String name,int x,int y,int h,int w)
> >> SS> {
> >> SS> super(name);
> >> SS> this.setBounds(x,y,h,w);
> >>
> >> SS> this.addWindowListener(new WindowAdapter() {
> >> SS> public void
>windowClosing(WindowEvent e){
> >> SS> System.exit(0);
> >> SS> }});
> >>
> >> SS> contentpane = this.getContentPane();
> >>
> >> SS> MethodPanel3D methPanel = new MethodPanel3D();
> >> SS> contentpane.add("Center",methPanel);
> >>
> >> SS> this.show();
> >> SS> }
> >>
> >> SS> public static void main(String[] args)
> >> SS> {
> >> SS> JFrame frame = new MethodView("Test for Java3D panel",50,50,500,500);
> >> SS> }
> >> SS> }
> >> SS> //////////////////////////////////////////////////////////////
> >> SS> //////////////////////////////////////////////////////////////
> >> SS> import javax.swing.*;
> >> SS> import java.awt.*;
> >> SS> import java.awt.event.*;
> >>
> >> SS> import com.sun.j3d.utils.universe.*;
> >> SS> import com.sun.j3d.utils.geometry.*;
> >> SS> import javax.media.j3d.*;
> >> SS> import javax.vecmath.*;
> >>
> >> SS> import com.sun.j3d.utils.geometry.ColorCube;
> >>
> >> SS> class MethodPanel3D extends JPanel
> >> SS> {
> >> SS> Canvas3D canvas;
> >>
> >> SS> public MethodPanel3D()
> >> SS> {
> >> SS> setOpaque(false);
> >>
> >> SS> canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
> >> SS> BranchGroup scene = createSceneGraph();
> >> SS> SimpleUniverse u = new SimpleUniverse(canvas);
> >> SS> u.getViewingPlatform().setNominalViewingTransform();
> >> SS> u.addBranchGraph(scene);
> >>
> >> SS> add("Center",canvas);
> >>
> >> SS> }
> >>
> >> SS> public BranchGroup createSceneGraph()
> >> SS> {
> >> SS> BranchGroup objRoot = new BranchGroup();
> >>
> >> SS> objRoot.addChild( new ColorCube(0.4) );
> >>
> >> SS> return objRoot;
> >> SS> }
> >>
> >> SS> /*
> >> SS> public void paintComponent(Graphics g)
> >> SS> {
> >> SS> super.paintComponent(g);
> >> SS> g.drawString("test",50,50);
> >> SS> }
> >> SS> */
> >>
> >> SS> }
> >> SS> //////////////////////////////////////////////////////////////
> >> SS> //////////////////////////////////////////////////////////////
> >>
> >> SS> ===========================================================================
> >> SS> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >> SS> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> >> SS> [EMAIL PROTECTED] and include in the body of the message "help".
> >>
> >> ===========================================================================
> >> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> >> [EMAIL PROTECTED] and include in the body of the message "help".
>
> DT> --
> DT> Best regards,
> DT> Dan Todor
> DT> ---
> DT> You can have it done FAST | \
> DT> You can have it done RIGHT | | --- Pick any two.
> DT> You can have it done CHEAP | /
--
Best regards,
Dan Todor
---
You can have it done FAST | \
You can have it done RIGHT | | --- Pick any two.
You can have it done CHEAP | /
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".