Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

My java applet program does not appear in appletviwere!!!

 
Greenhorn
Posts: 13
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I write a java applet program in netbeans IDE. But when i test it in appletviwere it does not appear and give me errore as in the picture.

My html file contains:



What is the problem??

Thank you.... .



appletviewer.JPG
[Thumbnail for appletviewer.JPG]
 
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the future, please do not post screenshots of error messages - post the error messages as text so that they're searchable.

It looks as if the applet class is part of a package; the APPLET tag's code attribute must reflect that.
 
Lolo Mohammed
Greenhorn
Posts: 13
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i chang the APPLET tag to

<applet code="OthelloGame/OtheApplet.class" width="600" height="500">
</applet>

It give me this error:

load: class OthelloGame/OtheApplet.class not found.
java.lang.ClassNotFoundException: OthelloGame.OtheApplet.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:785)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
at sun.applet.AppletPanel.run(AppletPanel.java:368)
at java.lang.Thread.run(Thread.java:619)
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the file OtheApplet.class in a directory called OthelloGame which is at the same level as the HTML file? If not then you need to make it so.
 
Lolo Mohammed
Greenhorn
Posts: 13
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is work

thank you very much...

but why it must be out of the pakage folder???
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's just how Java works; see http://download.oracle.com/javase/tutorial/java/package/index.html for more information, particularly the section "Managing Source and Class Files".
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic