我从sun.com下载了java3D的api,也安装了,但我用的编程软件还是显示不支持3D, 
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
这些import全显示package not found.....
我用的编程软件是"ready to program with java technology"
不知道哪位高手能帮帮我。
如果没听说过以上软件,要能告诉我怎么用JBuider做也行。。万分感谢!!!!

解决方案 »

  1.   

    应该配置jdk吧,把j3d的包加进去,具体的没有用过.
      

  2.   

    我刚下的jdk,也重装了三四遍j3d,可还是不行,,,,
      

  3.   

    比如说我打入如下代码,用JBuilder enterprise 2005 
    import java.awt.Frame;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;public class lesson01 extends Applet
    { // notice'lesson01', which is also the name of the file : lesson01.java
        SimpleUniverse simpleU; // this is the SimpleUniverse Class that is used for Java3D    public lesson01 ()
        { // this constructor is sometimes needed, even when empty as in here
        }
        public void init ()
        {
    // this function will be called by both applications and applets
    //this is usually the first function to write
    setLayout (new BorderLayout ()); // standard Java code for BorderLayout // Canvas3D is where all the action will be taking place, don't worry, after adding it
    // to your layout, you don't have to touch it.
    Canvas3D c = new Canvas3D (SimpleUniverse.getPreferredConfiguration ()); // add Canvas3D to center of BorderLayout
    add ("Center", c); simpleU = new SimpleUniverse (c); // setup the SimpleUniverse, attach the Canvas3D
    //This is very important, the SceneGraph (where all the action takes place) is created
    //by calling a function which here is called 'createSceneGraph'.
    //The function is not necessary, you can put all your code here, but it is a
    //standard in Java3D to create your SceneGraph contents in the function 'createSceneGraph' BranchGroup scene = createSceneGraph (); //set the ViewingPlatform (where the User is) to nominal, more on this in the next lesson
    simpleU.getViewingPlatform ().setNominalViewingTransform (); // this will optimize your SceneGraph, not necessary, but it will allow your program to run faster.
    scene.compile ();
    simpleU.addBranchGraph (scene); //add your SceneGraph to the SimpleUniverse
        }
        public BranchGroup createSceneGraph ()
        {
    //Here we will create a basic SceneGraph with a ColorCube object // This BranchGroup is the root of the SceneGraph, 'objRoot' is the name I use,
    // and it is typically the standard name for it, but can be named anything.
    BranchGroup objRoot = new BranchGroup (); // create a ColorCube object of size 0.5
    ColorCube c = new ColorCube (0.5f); // add ColorCube to SceneGraph
    objRoot.addChild (c); // return Scene Graph
    return objRoot;
        }
        public void destroy ()
        { // this function will allow Java3D to clean up upon quiting
    simpleU.removeAllLocales ();
        }
        public static void main (String [] args)
        {
    // if called as an application, a 500x500 window will be opened
    //Frame frame = new MainFrame (new lesson01 (), 500, 500);
            System.out.println("hello");
        }
    }错误是:
    C:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath "C:\Documents and Settings\Owner\jbproject\untitled1\classes;C:\Borland\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\charsets.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jce.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jsse.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\plugin.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\rt.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;C:\Borland\JBuilder2005\jdk1.4\lib\dt.jar;C:\Borland\JBuilder2005\jdk1.4\lib\htmlconverter.jar;C:\Borland\JBuilder2005\jdk1.4\lib\tools.jar"  java.applet.Applet 
    java.lang.NoSuchMethodError: mainException in thread "main" 各位高手帮帮忙阿
      

  4.   

    3d包路径问题
    假如jdk在:C:\jdk1.4\
    那么3d包的目标路径:C:\jdk1.4\jre\lib\ext
      

  5.   

    我发现我用JBuilder 什么程序都运行不了,就连最简单的程序都不行。可能是我才开始用吧,不知道怎么设置configuration.... 郁闷阿,各位高手能帮帮我吗?
      

  6.   

    谢谢,,刚刚又试了一遍,唉~~~~连如下程序都运行不起来
    public class untitled
    {
        public static void main (String[]args)
        {
            System.out.println("how are you");
        }
    }
    系统错误:
    java.lang.NoClassDefFoundError: c:\j2sdk1/4/2_08\demo\java3d\HelloUniverse\HelloUniverse/javaException in thread "main" 
    我用的是JBuilder 2005 Enterprise,
    无尽地等待回复中,,谢谢
      

  7.   

    晕,建议你去这个地方:www.programfan.com的jb版
    这里的人民不太友好,你问这样的问题会挨骂的。
      

  8.   

    呵呵,毕业的时候做的就是JAVA3D,现在没想到还有人在做啊,应该是环境变量的问题,你可以在当前目录试试。