标题:请问,如何运行Applet程序?
只看楼主
65063251
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-4-1
 问题点数:0 回复次数:2 
请问,如何运行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.html也不行,运行出现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 运行 
2005-04-05 15:33
freedxw
Rank: 1
等 级:新手上路
帖 子:86
专家分:0
注 册:2005-3-31
得分:0 
应再编写一个html文档名为:out.html
<applet code=out.class height=300 width=300></applet>
运行命令:appletviewer  out.html

再试试吧!

天不知道,地知道, 你不知道,我知道!
2005-04-05 18:30
65063251
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-4-1
得分:0 
恩 知道了 谢谢。
2005-04-05 21:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-14860-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.728640 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved