| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1315 人关注过本帖
标题:求助!JAVA3D问题:Exception in thread "J3D-Renderer-1" java.lang.Illeg ...
只看楼主 加入收藏
lengyue2008
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-30
收藏
 问题点数:0 回复次数:2 
求助!JAVA3D问题:Exception in thread "J3D-Renderer-1" java.lang.IllegalStat
Exception in thread "J3D-Renderer-1" java.lang.IllegalStateException: GL_VERSION

请问是什么问题?
搜索更多相关主题的帖子: Exception thread java VERSION lang 
2008-11-30 17:10
renyinick
Rank: 1
来 自:北京
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-7-19
收藏
得分:0 
很简单的异常问题嘛~
在你的代码里 你觉得能出现异常的地方try一下  然后再catch一下 试试看~
2008-12-01 13:07
lengyue2008
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-30
收藏
得分:0 
我知道动不动贴代码上来很讨厌。。但是我还是不得不贴一下。我觉得这个不是逻辑错误导致的异常吧。。。
package jexam2view;
import java.applet.Applet;
import java.awt.BorderLayout;
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 com.sun.j3d.utils.behaviors.mouse.MouseRotate;
import com.sun.j3d.utils.behaviors.mouse.MouseZoom;
import com.sun.j3d.utils.behaviors.mouse.MouseTranslate;
import java.awt.GraphicsConfiguration;

/**
 *
 * @author Evolution
 */
public class JExam2View extends Applet{

    private SimpleUniverse universe ;

public JExam2View()
{
   
}   

public void init()
{      
     //canvas to draw on, ask SimpleUniverse what config to use     
     Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());      
     setLayout(new BorderLayout());      
     add("Center", canvas);           

     //create top of our scene graph      
     BranchGroup scene = new BranchGroup();               

     //create universe, and attach our geometry to it.      
     SimpleUniverse u = new SimpleUniverse(canvas);      
     u.getViewingPlatform().setNominalViewingTransform();              

     // Create the bounding leaf node
     BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);

     // Create the transform node
     TransformGroup transformGroup = new TransformGroup();
     transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
     transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

     // Create the drag behavior node
     MouseRotate behavior = new MouseRotate();
     behavior.setTransformGroup(transformGroup);
     transformGroup.addChild(behavior);
     behavior.setSchedulingBounds(bounds);

     // Create the zoom behavior node
     MouseZoom behavior2 = new MouseZoom();
     behavior2.setTransformGroup(transformGroup);
     transformGroup.addChild(behavior2);
     behavior2.setSchedulingBounds(bounds);

     // Create the zoom behavior node
     MouseTranslate behavior3 = new MouseTranslate();
     behavior3.setTransformGroup(transformGroup);
     transformGroup.addChild(behavior3);
     behavior3.setSchedulingBounds(bounds);

     transformGroup.addChild(new ColorCube(0.4));
  
     scene.addChild(transformGroup);   
     u.addBranchGraph(scene);
}   
  
  
// The following allows UglyCube to be run as an application   
// as well as an applet   
public static void main(String[] args)
{        
     new MainFrame(new JExam2View(), 256, 256);   
}



}
2008-12-01 16:09
快速回复:求助!JAVA3D问题:Exception in thread "J3D-Renderer-1" java.lang. ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031899 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved