我的Java applet程序没有出现在appletviwere中吗? [英] My java applet program does not appear in appletviwere?

查看:120
本文介绍了我的Java applet程序没有出现在appletviwere中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在netbeans IDE中编写了一个Java applet程序.但是,当我在applet浏览器中对其进行测试时,它没有出现,并给我这个错误:

Hi,

I write a java applet program in netbeans IDE. But when I test it in applet viewer it does not appear and give me this error:

java.lang.NoClassDefFoundError: OtheApplet (wrong name: OthelloGame/OtheApplet)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	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.Plugin2ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NoClassDefFoundError: OtheApplet (wrong name: OthelloGame/OtheApplet)



我的html文件包含:



My html file contains:

 <html>
  <head>
    <title>Othello Evaluation Environment</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
      <applet code="OtheApplet.class" width="600" height="500">

      </applet>

  </body>

</html>



有什么问题吗?
请任何人可以帮助我:(
谢谢....



What is the problem?
please can anyone help me :(
Thank you....

推荐答案

AppletExecutionRunnable.run(未知源) 在java.lang.Thread.run(未知来源) 异常:java.lang.NoClassDefFoundError:OtheApplet(名称:OthelloGame/OtheApplet)
AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception: java.lang.NoClassDefFoundError: OtheApplet (wrong name: OthelloGame/OtheApplet)



我的html文件包含:



My html file contains:

 <html>
  <head>
    <title>Othello Evaluation Environment</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
      <applet code="OtheApplet.class" width="600" height="500">

      </applet>

  </body>

</html>



有什么问题吗?
请任何人可以帮助我:(
谢谢....



What is the problem?
please can anyone help me :(
Thank you....


嘿,只是尝试
<html>  <head>    <title>Othello Evaluation Environment</title> 
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
</head>  <body>      <applet code="OtheApplet" width="600" height="500">      </applet>  </body></html>



是的,即使是大写和小写,您的类名也必须与applet代码名匹配.



And yes your class name must match with applet code name in even capital and small case


非常感谢...
我找到了解决方法..

.html文件必须位于包的外部..

谢谢..:)
Thank you very much...

I found the solution..

the .html file must be located out side the pakage..

thank you..:)


这篇关于我的Java applet程序没有出现在appletviwere中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆