• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Lolo Mohammed
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]
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • 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
Pie
Posts: 42967
73
  • 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
Pie
Posts: 42967
73
  • 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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic