比如applet文件是AppletTest.class
1)
在AppletTest.java的代码中
使用默认包,即不用package语句
在html页中的代码是
<applet code="AppletTest.class" width="400" height="300">
</applet>
AppletTest.class文件和html页放在一个文件夹中
2)
在AppletTest.java的代码中
package xx.yy;
在html页中的代码是
<applet code="xx.yy.AppletTest.class" width="400" height="300">
</applet>
AppletTest.class文件放在xx/yy文件夹中
html页放xx文件夹的上层目录中
这两种情况都能正常显示
本文介绍了如何将Java Applet与HTML页面集成的两种常见方式。一种是在默认包下使用Applet,另一种则是通过指定包名的方式。文章详细说明了在不同情况下Applet类文件与HTML文件的放置位置及引用方式。
8165

被折叠的 条评论
为什么被折叠?



