问题
When i try to load an applet with :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="Sokoban" />
</object>
when the html file is in the same directory as the applet it loads as expected.
But when the applet is in an another directory the following code won't work :
<object type="application/x-java-applet" height="300" width="550">
<param name="code" value="sokoban/Sokoban" />
</object>
(sokoban is the directory the applet is in, Sokoban is the applet => Sokoban.class)
回答1:
- Use
deployJava.js
to deploy the applet (linked from the applet info. page). - Use the
codebase
attribute to point to thesokoban
directory. - Since the
code
attribute needs to be the fully qualified class name, return it to justSokoban
来源:https://stackoverflow.com/questions/10250671/cant-load-java-applet-from-another-directory-in-html