无法从HTML中的另一个目录加载Java小程序 [英] Can't load Java applet from another directory in HTML

查看:189
本文介绍了无法从HTML中的另一个目录加载Java小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试加载一个小程序:

When i try to load an applet with :

<object type="application/x-java-applet" height="300" width="550">
  <param name="code" value="Sokoban" />
</object>

当html文件与预期加载的小程序位于同一目录中时。

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>

/ p>

(sokoban is the directory the applet is in, Sokoban is the applet => Sokoban.class)

推荐答案


  1. 使用 deployJava.js 部署该小程序(从小程序信息页面链接)。

  2. 使用 codebase 属性指向 sokoban 目录。

  3. 由于代码属性需要是完全限定的类名,请将其返回到 Sokoban

  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

这篇关于无法从HTML中的另一个目录加载Java小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆