Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 3D / Problem with chapter 1 from Sun's Java3D on: 2004-11-08 12:16:46
Hi,
I've got a problem viewing my applet. I can't find any mistake into the code.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;
import javax.media.j3d.*;
import javax.vecmath.*;

public class HelloJava3Da extends Applet {
      public HelloJava3Da() {
            setLayout(new BorderLayout());
            GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
            Canvas3D canvas3D = new Canvas3D(config);
            add("Center", canvas3D);
           
            BranchGroup scene = createSceneGraph();
            scene.compile();
           
            //simpleUniverse is a convenience utility class
           SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
           
            //this moves the viewplatform back a bit so the
           //objects in the scene can be viewed
           simpleU.getViewingPlatform().setNominalViewingTransform();
            simpleU.addBranchGraph(scene);
      }
           
      public BranchGroup createSceneGraph() {
            //create the root of the branch graph
           BranchGroup objRoot = new BranchGroup();
           
            //Create a simple shape leaf node, add it to the scene graph.
           //ColorCube is a convenience Utility Class.
           objRoot.addChild(new ColorCube(0.4));
           
            return objRoot;
      }
     
      public static void main(String[] args){
            Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
      }
}

But I am a newbie. I think there's a browser problem. I am working with eclipse 3.1. The applet viever shows the applet [example Java3Da] But I don't see a cube. And I didn't get an error message into my eclipse console. If I try to open another applet with firefox 1.0  I get the following message:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
java.lang.VerifyError: (class: HexColor, method: keyDown signature: (Ljava/awt/Event;I)Z) Unsorted lookup switch

      at java.lang.Class.getDeclaredConstructors0(Native Method)

      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)

      at java.lang.Class.getConstructor0(Unknown Source)

      at java.lang.Class.newInstance0(Unknown Source)

      at java.lang.Class.newInstance(Unknown Source)

      at sun.applet.AppletPanel.createApplet(Unknown Source)

      at sun.plugin.AppletViewer.createApplet(Unknown Source)

      at sun.applet.AppletPanel.runLoader(Unknown Source)

      at sun.applet.AppletPanel.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

Does anybody know the problem?

thank you,
bolshi
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (36 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (41 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (60 views)
2014-09-21 02:42:18

BurntPizza (30 views)
2014-09-21 01:30:30

moogie (35 views)
2014-09-21 00:26:15

UprightPath (48 views)
2014-09-20 20:14:06

BurntPizza (52 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!