Author Topic: Is There any Applet example?  (Read 7944 times)

Offline gpsunjp

  • byte
  • *
  • Posts: 7
    • View Profile
Is There any Applet example?
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Is There any Applet example?
« Reply #1 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...

Offline gpsunjp

  • byte
  • *
  • Posts: 7
    • View Profile
Is There any Applet example?
« Reply #2 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]

Offline gpsunjp

  • byte
  • *
  • Posts: 7
    • View Profile
Is There any Applet example?
« Reply #3 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

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Is There any Applet example?
« Reply #4 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

Offline gpsunjp

  • byte
  • *
  • Posts: 7
    • View Profile
Is There any Applet example?
« Reply #5 on: June 02, 2006, 03:28:03 am »
Everything is going well.

Thank you all.

Sun
 :D

Offline frogger111

  • byte
  • *
  • Posts: 1
    • View Profile
Re: Is There any Applet example?
« Reply #6 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?


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Is There any Applet example?
« Reply #7 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