Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Problem with chapter 1 from Sun's Java3D  (Read 792 times)
0 Members and 1 Guest are viewing this topic.
Offline bolshi

Innocent Bystander




Java games rock!


« Posted 2004-11-08 13: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (15 views)
2014-07-30 21:08:39

Riven (22 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-07 18:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-13 15:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-13 15:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 02:13:37

HotSpot Options
by Roquen
2014-05-15 00:59:54

HotSpot Options
by Roquen
2014-05-06 06:03:10

Escape Analysis
by Roquen
2014-04-29 13:16:43

Experimental Toys
by Roquen
2014-04-28 04:24:22
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!