问题出在包装上。您需要更改applet的pre属性,并根据放置HTML的位置更改prebase属性。您必须将HellowApplet.class放在名为M257Applet的目录中(因为这是您提供的软件包),并且applet标记应类似于:
<applet pre="M257Applet.HellowApplet" ... ></applet>
为此,您的HTML必须与M257Applet位于同一目录(不在M257Applet内)。或者,您可以指定代码库属性。例如,具有以下目录结构:
somedir +-- hello.html +-- M257Applet | +-- HellowApplet.class
小程序将起作用。但是,如果您有
anotherdir +-- hello.html +-- somedir | +-- M257Applet | | +-- HellowApplet.class
那么您将必须像这样指定prebase属性:
<applet pre="M257Applet.HellowApplet" prebase="somedir" ... ></applet>
因此,您应该
prebase指向包含软件包的目录,并且
pre还必须在其中包含软件包名称。
编辑:请注意,即使
pre="HellowApplet.class"可以使用,但是指定小程序的正确方法是在末尾没有“ .class”。



