Is There any Applet example?

Started by gpsunjp, May 30, 2006, 08:15:41 AM

Previous topic - Next topic

gpsunjp

Hello,

I am a newer to JPCT. I want to make a Applet to display a 3D 3DS Object using JPCT. It will be very appreciated if anyone could give me such example.

Thank you

sun

EgonOlsen

Depends on what kind of applet it should be (passive rendering/normal Swing/AWT/GUI-applet vs. active rendering). For the latter, a very simple example is in this thread (it's a german thread but the code should be clear regardless of this): http://www.jpct.net/forum/viewtopic.php?t=474
That's for software renderer only. When using OpenGL in an applet, things are getting more complicated...

gpsunjp

Thank you for your reply.
I compiled the applet example but the applet can not be inited when executing.

I also compiled the bounce.java taken from jpctapi_096.zip with current jpct, it can not be inited too.

Anyone know why?

Sun
[/img]

gpsunjp

Let me give some supplementary error messages.

java.lang.NoClassDefFoundError: com/threed/jpct/FrameBuffer
       at ExampleApplet.init(ExampleApplet.java:20)
       at sun.applet.AppletPanel.run(AppletPanel.java:354)
       at java.lang.Thread.run(Thread.java:534)

My pc installed Java1.5.

Sun

manumoi

Ok. It s not a big problem i think. You need to verify that the jpct.jar file is correctly linked to your project. So you have to add its path to the CLASSPATH variable of your system (or directly in the command line when you launch your system, using the -classpath attribute).

There are other threads in the forum that are talking about the same problem. (just check it by making a research with the "classpath" keyword)

Another element that you have to put in the classpath is the lwjgl.jar file. You must also give an access to the lwjgl library.

When you want to add a jar file to an applet, you can do it this way


<APPLET CODE=a.class
    ARCHIVE="abc.jar" // the url of the jar file to add
    WIDTH=100
    HEIGHT=100>
</APPLET>


Emmanuel

gpsunjp

Everything is going well.

Thank you all.

Sun
:D

frogger111

First I'd to say Hello for everyone and sory for my English.
I'm a newbie to jPTC, I compiled the applet example as well.

When I try to run applet in NetBeans I've got an error:
run:
java.lang.NoClassDefFoundError: java
Caused by: java.lang.ClassNotFoundException: java
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: java.  Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)


What am I doing wrong?


EgonOlsen

Have you had a look at the Applet page in the wiki? Maybe it helps: http://www.jpct.net/wiki/index.php/Applets