Applet code tags and class files

自古美人都是妖i 提交于 2019-12-02 07:17:17
<applet code="myPackage.myCLass.class"width="500"height="500">

As to the applet element for a myClass applet class in the myPackage package.

1) An applet element should have spaces between the attributes (I'm not sure if that is part of the W3C recommendation, but it just looks weird).

<applet code="myPackage.myCLass.class" width="500" height="500">

2) The code attribute should be the fully qualified name of the class, which means:

<applet code="myPackage.myCLass" width="500" height="500">

3) With no archives and no codebase specified, the JRE would look for the class in the myPackage sub-directory of the directory from which the HTML is loaded. E.G. if the HTML is called applet.html and is located at:

The class would need to be located at:

Once you think you have the applet class correct, try fetching it using the address in the browser address bar. If the class is not offered for download, the JRE won't be able to load it either.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!