gpt4 book ai didi

java - java小程序中的值传递

转载 作者:太空宇宙 更新时间:2023-11-04 08:32:14 25 4
gpt4 key购买 nike

我在java小程序中传递值,但值是空的

我的小程序部署 JavaScript:

<script src="javascript/deployJava.js"></script>
<script>
var attributes = { id:'dynamictreeapplet', code:'jstojava.com.vaannila.utility.dynamicTreeApplet.class',width:1000,height:1000} ;
var parameters = {jnlp_href:'./appletjars/a.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>

我的jnlp

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/docRuleToolProtocol/appletjars/" href="a.jnlp">

<information>
<title>dynamictree</title>
<vendor>Ashutosh</vendor>
</information>

<resources>
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se" />
<jar href="dynamictree.jar" main="true" />
<jar href="prefuse.jar" main="true" />
</resources>

JavaScript 传递值:

function showSelected(value){
alert("the value given from"+value);
var diseasename=value;
alert(diseasename);
dynamictreeapplet.dieasenameencode=diseasename;
}

<applet-desc name="dynamictree" main-class="com.vaannila.utility.dynamicTreeApplet" width="500" height="500">
</applet-desc>
</jnlp>

最佳答案

改变

dynamictreeapplet.dieasenameencode=diseasename;

document.dynamictreeapplet.dieasenameencode=diseasename;

可能还有 dieasenameencode 到疾病名称编码 。

关于java - java小程序中的值传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7269466/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com