This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Applets and the fly likes My java applet program does not appear in appletviwere!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "My java applet program does not appear in appletviwere!!!" Watch "My java applet program does not appear in appletviwere!!!" New topic
Author

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

Lolo Mohammed
Greenhorn

Joined: Mar 17, 2011
Posts: 13

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.... .





[Thumbnail for appletviewer.JPG]

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
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.


Ping & DNS - my free Android networking tools app
Lolo Mohammed
Greenhorn

Joined: Mar 17, 2011
Posts: 13

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
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
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

Joined: Mar 17, 2011
Posts: 13

it is work

thank you very much...

but why it must be out of the pakage folder???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
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".
 
Consider Paul's rocket mass heater.
 
subject: My java applet program does not appear in appletviwere!!!