Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (416)
games submitted by our members
Games in WIP (307)
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 682 times)
0 Members and 1 Guest are viewing this topic.
Offline bolshi

JGO Visitor



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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
mrbenebob (18 views)
2013-06-19 14:55:23

BrassApparatus (28 views)
2013-06-19 08:52:37

NegativeZero (31 views)
2013-06-19 03:31:52

NegativeZero (33 views)
2013-06-19 03:24:09

Jesse_Attard (37 views)
2013-06-18 22:03:02

HeroesGraveDev (74 views)
2013-06-15 23:35:23

Vermeer (75 views)
2013-06-14 20:08:06

davedes (76 views)
2013-06-14 16:03:55

alaslipknot (68 views)
2013-06-13 07:56:31

Roquen (91 views)
2013-06-12 04:12:32
Smoothing Algorithm Question
by UprightPath
2013-05-28 02:58:26

Smoothing Algorithm Question
by UprightPath
2013-05-28 02:57:33

Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38
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!