Java 3D and Swing: good idea?

Hi everyone,

I'm currently finishing the first parts of user interface built with Swing components. The canvas is used to display a 2D view on a model track. However, people have expressed interest in rendering a 3D view as well.

Although I know a few things about Java 3D and 3D programming in general, I am left with a question. How easy or difficult is it to display a 3D canvas inside a Swing GUI? I realize I'm probably going to have to disable lightweight components, but even then - is it not too tedious a task to display 3D scenegraphs in a JFrame or JWindow?

Thanks for your help.

[624 byte] By [hdevaan] at [2007-9-26 1:18:43]
# 1
Displaying 3D view inside JFrame is not difficult. But you should turn off lightweight behavior when you use JMenubar. Remember Canvas3D is a kind of Canvas, so you can put a canvas3d anywhere inside JFrame. You can play around with some demos in Java3D SDK.
LouisGL at 2007-6-29 0:50:06 > top of Java-index,Security,Cryptography...
# 2

The mixing of heavy weight components (i.e. Canvas, Canvas3D) with swing (light weight components) doesn't work well.

The biggest problem I had was trying to put a Canvas3D object inside a JScrollPane which was nested into a JInternalFrame. This doesn't not work well in version 1.3.0.

However, they have released vesion 1.3.1. As to what bug fixes they did pertaining to the mixing of heavy and light weight components, I am unsure. I'm sure they have all the updates / fixes made somewhere on their site. Could anyone provide a link to that page?

Regards,

Randall

7rst at 2007-6-29 0:50:06 > top of Java-index,Security,Cryptography...
# 3
Check out http://www.j3d.org/faq/swing.htmlIt tells you how to integrate Java3D with jmenubar.If you want to use a Canvas3d with a scrollbar you will need to use awt components.
mr_bob_666 at 2007-6-29 0:50:06 > top of Java-index,Security,Cryptography...