更新时间:2023-11-19 22:43:58
<applet code="myPackage.myCLass.class"width="500"height="500">
至于 myPackage
包中 myClass
小程序类的 applet
元素.
As to the applet
element for a myClass
applet class in the myPackage
package.
1) applet
元素的属性之间应该有空格(我不确定这是否是 W3C 建议的一部分,但它看起来很奇怪).
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) code
属性应该是类的全限定名,意思是:
2) The code
attribute should be the fully qualified name of the class, which means:
<applet code="myPackage.myCLass" width="500" height="500">
3) 在没有指定存档和代码库的情况下,JRE 将在加载 HTML 的目录的 myPackage
子目录中查找该类.例如.如果 HTML 被称为 applet.html
并且位于:
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:
该类需要位于:
一旦您认为小程序类正确,请尝试使用浏览器地址栏中的地址获取它.如果该类不提供下载,JRE 也将无法加载它.
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.