• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

insertin g a class in an applet

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi , I am trying to in a webcamera in an applet then I use the next code:

<applet code="webcam.class" codebase="../bean/" archive="webcam.jar" width="320" height="240">

I have revised a lotrs of times and the path doesn´t give me more that the next error:

cargar: clase webcam.class no encontrada.
java.lang.ClassNotFoundException: webcam.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.P

¿Any clue?

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try removing ".class" from the code attribute - the attribute takes a class name, not a file name.

webcam.class is in the top level of the webcam.jar file? which itself is in a parallel directory called "bean" to the directory where the HTML file resides?
 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The webcam.class is in the bean package which is parallel to the WebPages folder where the .xhtml is in.

I am using Glassfish and Netbeans. Also the .jar is in the path of the project and in the path of WebPages folder.

I have tried all posibilities I have found, and it never finds it.

¿Any idea?

Thanks
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the class is in a package then the code attribute needs to reflect that - it takes the fully qualified class name.

I'm not quite sure what the directory layout of all your files is; maybe you can make that a bit clearer. I advise not to use an IDE to run applets; they cause the applet to work differently than it would in reality.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic