使用旧小程序中的deployjava.js 添加参数

发布于 2024-11-25 09:18:09 字数 1271 浏览 3 评论 0原文

我正在使用deployjava.js来部署这个小程序

<script src="http://java.com/js/deployJava.js"></script><script> 
    var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:640, height:480} ; 
    var parameters = {jnlp_href: 'plugin2.jnlp'} ; 
    deployJava.runApplet(attributes, parameters, '1.6'); 
</script>

小程序的API表示要传递这些参数(特别是画布)

我尝试过这个

<script src="http://java.com/js/deployJava.js"></script>
<script> 
var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code:         'Painter.class', archive:'painter.jar', width:640, height:480} ; 
    var parameters = {jnlp_href: 'plugin2.jnlp', gui:'canvas.gui'} ; 
    deployJava.runApplet(attributes, parameters, '1.6'); 
</script>

,显然这是不正确的。让它发挥作用的正确方法是什么?

自然语言处理

<resources> 
    <j2se version="1.4+"/> 
    <jar href="/devel/app/webroot/jpainter/applet/painter.jar"/> 
</resources> 

<applet-desc name="painter" main-class="Painter" width="640" height="480"> 
<param name="plugin2" value="true" />
</applet-desc> 
</jnlp>

I am using deployjava.js to deploy this applet

<script src="http://java.com/js/deployJava.js"></script><script> 
    var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:640, height:480} ; 
    var parameters = {jnlp_href: 'plugin2.jnlp'} ; 
    deployJava.runApplet(attributes, parameters, '1.6'); 
</script>

The API for the applet says to pass these params (specifically the canvas)

I tried this

<script src="http://java.com/js/deployJava.js"></script>
<script> 
var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code:         'Painter.class', archive:'painter.jar', width:640, height:480} ; 
    var parameters = {jnlp_href: 'plugin2.jnlp', gui:'canvas.gui'} ; 
    deployJava.runApplet(attributes, parameters, '1.6'); 
</script>

And clearly that is not correct. What is the correct way to get this working?

JNLP

<resources> 
    <j2se version="1.4+"/> 
    <jar href="/devel/app/webroot/jpainter/applet/painter.jar"/> 
</resources> 

<applet-desc name="painter" main-class="Painter" width="640" height="480"> 
<param name="plugin2" value="true" />
</applet-desc> 
</jnlp>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难如初 2024-12-02 09:18:09

如果将来有人偶然发现这一点,当您调用该属性并为其提供 .jar 文件的位置时,不需要同时引用 jnlp。

<script type="text/javascript" src="https://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = {name: 'painter', codebase: BASE_DIR + '/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:742, height:262} ; 
var parameters = {gui:'canvas.gui', image_width:'740', image_height:'260', stroke:'solid3'};
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>

In case someone stumbles upon this in the future, when you call the attribute and give it the location of your .jar file, it isn't needed to also reference the jnlp.

<script type="text/javascript" src="https://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = {name: 'painter', codebase: BASE_DIR + '/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:742, height:262} ; 
var parameters = {gui:'canvas.gui', image_width:'740', image_height:'260', stroke:'solid3'};
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文