Can't load Java applet from another directory in HTML

时光毁灭记忆、已成空白 提交于 2019-12-20 05:43:15

问题


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:


  1. Use deployJava.js to deploy the applet (linked from the applet info. page).
  2. Use the codebase attribute to point to the sokoban directory.
  3. Since the code attribute needs to be the fully qualified class name, return it to just Sokoban


来源:https://stackoverflow.com/questions/10250671/cant-load-java-applet-from-another-directory-in-html

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