1)将Java源文件编译成类文件。
2)创建一个HTML文件,告诉浏览器首先加载哪个类文件以及如何设定applet的大小。
<applet code="applet/*.class" width="300" height="300">
</applet>
在浏览器中查看applet之前,最好使用JDK自带的applet查看器(applet viewer)对applet测试一下。
appletviewer *.html
也可以在集成环境中运行applet。在Eclipse中,从菜单中选择Run->Run as ->Java Applet。