www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: gpsunjp on May 30, 2006, 08:15:41 am

Title: Is There any Applet example?
Post by: gpsunjp on May 30, 2006, 08:15:41 am
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
Title: Is There any Applet example?
Post by: EgonOlsen on May 30, 2006, 04:31:18 pm
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...
Title: Is There any Applet example?
Post by: gpsunjp on June 01, 2006, 05:04:47 am
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]
Title: Is There any Applet example?
Post by: gpsunjp on June 01, 2006, 06:36:02 am
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
Title: Is There any Applet example?
Post by: manumoi on June 01, 2006, 05:46:32 pm
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

Code: [Select]

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


Emmanuel
Title: Is There any Applet example?
Post by: gpsunjp on June 02, 2006, 03:28:03 am
Everything is going well.

Thank you all.

Sun
 :D
Title: Re: Is There any Applet example?
Post by: frogger111 on June 02, 2010, 10:22:29 pm
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?

Title: Re: Is There any Applet example?
Post by: EgonOlsen on June 02, 2010, 11:38:43 pm
Have you had a look at the Applet page in the wiki? Maybe it helps: http://www.jpct.net/wiki/index.php/Applets (http://www.jpct.net/wiki/index.php/Applets)