【Java笔记】applet和html注意

1.首先记得extends Applet 泪目

 

2.如果不分包,HTML可以写

<applet code="HelloWorldApplet.class" width=150 height=25></applet>
然后HelloWorldApplet.class和index.html文件放同一个文件夹
控制台进入该文件夹 appletviewer index.html 可运行 
 
3.如果用eclipse写的
把html放在项目的bin文件夹下
<applet code="test.HelloWorldApplet.class" width=150 height=25></applet>
其中test是包名
然后控制台进入bin目录appletviewer index.html 可运行
 
4.jdk1.6以上版本无法直接在网页里运行,需要浏览器做一些操作。
 
5.最后,在2019年applet已经过时,了解考试部分即可。
 
 
posted @ 2019-08-29 14:47  海底淤泥  阅读(338)  评论(0编辑  收藏  举报