Hi Paul, You are right. The Canvas 3D is taking all the area left by the Swing components. The program gives the "ilusion" that the Swing component is on the Canvas 3D but in fact is not.
Regards, Alejandro -----Original Message----- From: Discussion list for Java 3D API [mailto:JAVA3D-INTEREST@;JAVA.SUN.COM]On Behalf Of Paul Pantera Sent: Friday, October 25, 2002 11:44 AM To: [EMAIL PROTECTED] Subject: Re: [JAVA3D] Swing component on Canvas3D > Hi Alex, > > Try the attached code and see if that is what you > are looking for. The code is within init(), but > you could improve it by creating a self-contained > JPanel as a subclass of JPanel that will add the > text or events or both, then add it to a part of > the layout of the Container (in this case a JApplet). > > Hope this helps. Regards, > > Alejandro > Very nice. I'm surprised this worked. The Java 3D canvas is a heavyweight object, so if you try to put lightweight Swing components on top of it, they will show up below the Canvas (obscured). The exceptions are Popup Menus and Tooltips, which we can force to be heavyweight. I think what your app is doing is not putting the Swing components on top of the Canvas, but next to it. The BorderLayout, I assume, is only giving the Canvas the area of the window that you see. It does not extend to beneath the JTextAreas. The workaround for putting Swing components on top of a Canvas 3D is to use AWT components instead. We were considering using "Skins" to get cool looking Swing components and putting them on our dashboard inside the Canvas 3D. (If you don't know about Skins in Swing see http://javootoo.l2fprod.com/plaf/skinlf/index.php) But since Swing components are inherently lightweight, I concluded that it wouldn't work. Therefore, if we want GUI-like components on our dashboard, we will have to build them up ourselves. Anyone know a way around this? -Paul =========================================================================== 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". =========================================================================== 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".
