发新话题
打印

【求助】Applet不能运行

【求助】Applet不能运行

就是下面这个程序,在网页中打不开,请教教,谢谢!

Applet程序:
import java.awt.*;
import java.applet.*;
class AppletClassicExample extends Applet
{
public void paint(Graphics g)
{
  g.drawString("欢迎来到JAVA网络游戏世界...",10,50);
}
}

HTML代码:
<!-- 内嵌Applet的网页 ->
<html>
  <head><title>基本的Applet程序</title></head>
  <body>
   <applet code="test.class" width=200 height=100>
   </applet>
  </body>
</html>

TOP

和Windows一样!
首先编好*.html
然后在命令行里appletviewer  *.html回车

TOP

我的系统里根本没有appletviewer

TOP

类要声明为public,要不然加载不了!
"<applet code="test.class" width=200 height=100>"要改为
<applet code="AppletClassicExample.class" width=200 height=100>

TOP

发新话题