Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using Jview3D

Status
Not open for further replies.

Guigui

IS-IT--Management
Mar 7, 2001
5
FR
hello,<br><br>i've some problems when i compilate my file.<br>i've this error:<br>Exception occurred during event dispatching:
<br>java.lang.NoClassDefFoundError: javax/media/j3d/Group
<br> at essai1.BasicView.&lt;init&gt;(basicview.java:40)
<br><br><br><br><br>and here my file:<br><br>package essai1;<br>import com.interactive.v3d.view.v3dView;<br>import com.interactive.v3d.axis.v3dAxis;<br>import com.interactive.v3d.axis.v3dPlaneAxis;<br>import com.interactive.v3d.behavior.tool.*;<br>import com.interactive.v3d.model.models.v3dContainer;<br>import javax.vecmath.*;<br>import javax.media.j3d.*;<br>import java.applet.Applet;<br>import java.awt.*;<br>import java.awt.event.*;<br>import javax.swing.*;<br>public class BasicView extends JPanel//Applet<br>&nbsp;{<br><br>/** Initializes the window width constant to 400 pixels. */<br> protected static int WIDTH = 600;<br><br> /** Initializes the window height constant to 400 pixels. */<br> protected static int HEIGHT = 600;<br><br>public BasicView()<br>{}<br>public v3dView view;<br>&nbsp;&nbsp;protected v3dContainer _container;<br><br><br>&nbsp;&nbsp;public BasicView(String title) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.init();<br> createUI(title);<br>&nbsp;&nbsp;}<br><br><br><br>&nbsp;&nbsp;public void init()<br>&nbsp;&nbsp;{<br><br>&nbsp;&nbsp;&nbsp;view = new v3dView();<br><br>&nbsp;&nbsp;&nbsp;// create a container<br>&nbsp;&nbsp;&nbsp;_container = new v3dContainer();<br><br>&nbsp;&nbsp;// add container into viewer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;view.addContainer(_container);<br><br>&nbsp;&nbsp;&nbsp;// create a plane axis and add into viewer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v3dAxis axis = new v3dPlaneAxis(&quot;X&quot;, &quot;Y&quot;, &quot;Z&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;view.setAxis(axis);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Lays out the applet.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// setLayout(new BorderLayout());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// this.add(view.getCanvas3D(), BorderLayout.CENTER);<br><br><br>&nbsp;&nbsp;}<br><br>/**<br> * Displays the 3D objects to be rendered and displayed. This method<br> * is called only when &lt;code&gt;BasicView&lt;/code&gt; is used as an<br> * application instead of an applet.<br> */<br>&nbsp;&nbsp;&nbsp;&nbsp;public void render(String title) {<br> this.init();<br> createUI(title);<br> }<br><br>&nbsp;/**<br> * Creates a 400 by 400 pixel window that can be used for displaying<br> * View 3D objects.<br> *<br> * @param app the applet to display<br> * @param title the window title<br> */<br> protected void createUI(String title) {<br> // Creates a window.<br>&nbsp;&nbsp; JFrame f = new JFrame(title);<br><br> f.getContentPane().add(this);<br> f.addWindowListener(new WindowAdapter() {<br> public void windowClosing(WindowEvent e) {<br> System.exit(0);<br> }<br> });<br> f.setSize(WIDTH, HEIGHT);<br> Dimension d = Toolkit.getDefaultToolkit().getScreenSize();<br> Point pos = new Point((d.width - WIDTH) / 2, (d.height - HEIGHT) / 2);<br> f.setLocation(pos);<br> f.show();<br> }<br><br>&nbsp;&nbsp;// Afficher un point<br>&nbsp;&nbsp;public void affiche_position (position pos)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;}<br><br>}<br><br><br>So, if someone knows the problem !!!<br><br>Thanks in advance.<br><br>guillaume<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top