当前位置: 代码迷 >> Java相关 >> 请问,如何运行Applet程序?
  详细解决方案

请问,如何运行Applet程序?

热度:349   发布时间:2005-04-05 15:33:00.0
请问,如何运行Applet程序?
一个简单的小程序:
import java.applet.Applet;
import java.awt.Graphics;
public class out extends Applet
{
public void paint(Graphics g)
{
  g.drawString("out",10,10);
}
}
如何运行?我编辑以后,生成一个.class的文件,但是不能运行,运行出现Exception in thread "main" java.lang.NoSuchMethodError: main
用以下命令:AppletViewer out也不行,运行出现Warning: Can't read AppletViewer properties file: C:\Documents and Settings\sdw\
.hotjava\properties Using defaults.
I/O exception while reading: D:\save\inout.htm (The system cannot find the file
specified)
谁能告诉我是什么原因?谢谢了。

[此贴子已经被作者于2005-4-5 15:34:49编辑过]


搜索更多相关的解决方案: Applet  运行  

----------------解决方案--------------------------------------------------------
应再编写一个html文档名为:out
<applet code=out.class height=300 width=300></applet>
运行命令:appletviewer  out

再试试吧!
----------------解决方案--------------------------------------------------------
恩 知道了 谢谢。
----------------解决方案--------------------------------------------------------