先运行,编译出class 文件,然后写一个htm文件,文件内容如下:
<html>
<title>第一个Applet程序</title>
<body>
<applet code=ex518.class width=800 height=600>
</applet>
</body>
</html>
再双击htm用浏览器打开
<html>
<title>第一个Applet程序</title>
<body>
<applet code=ex518.class width=800 height=600>
</applet>
</body>
</html>
再双击htm用浏览器打开
我重新安装JDK后仍然不能运行.
我又定了一个简单的程序,如下:
package ex;
import java.applet.Applet;
import java.awt.*;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class zz extends Applet{
TextField tf1,tf2;
Button bt1,bt2;
public void init(){
tf1=new TextField(30);
tf2=new TextField(30);
bt1=new Button("确定");
bt2=new Button("注册");
add(tf1);
add(tf2);
add(bt1);
add(bt2);
}
}
也不能够运行!请大家帮助.