我有一个小程序,在 7u45 下的 java 版本和 firefox 中工作正常,但是当我将 java 更新到最新版本时,我的小程序会加载,但它不会出现,除非我尝试使用 chrome 检查该项目,否则它会出现展示。 以下是控制台日志:
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: isLoggable(ALL) : true
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: Loading of child applet successfull
févr. 02, 2014 11:56:46 AM mt.common.util.applet.myapplet init
Infos: OK : the child applet is an instance of myapplet
févr. 02, 2014 11:56:46 AM org.modula.applet.document.myapplet1 init
Infos: init() myapplet1 2.0
févr. 02, 2014 11:56:48 AM org.modula.applet.document.myapplet1 init
Infos: End init()
testmepl6
févr. 02, 2014 11:56:48 AM mt.common.util.applet.applet start
Infos: Start...
我这样称呼 myapplet:
var attributes = {id:"appletInstance",
name:"appletInstance",
code:"mt.common.util.applet.myapplet",
codebase:"<%=urlCodeBase %>",
width:150, height:30};
var parameters = {jnlp_href: "<%=urlJnlp %>"};
<div style="text-align: center; float:right;">
<%= bordPanelState.getHTMLTop() %>
<div id="divPopupActions" style="text-align: center; padding: 2px 5px 2px 5px;">
<%if(vUrlFile.size()>0){ %>
<!---------------------------------------->
<!---------------- Applet ---------------->
<!---------------------------------------->
<!-- <script src="http://www.java.com/js/deployJava.js" type="text/javascript"></script> -->
<script src="<%= rootPath %>include/js/java/deployJava.js"></script>
<script type="text/javascript">
deployJava.runApplet(attributes, parameters, '1.6');
</script>
<%} %>
</div>
<%= bordPanelState.getHTMLBottom() %>
</div>
这是我的 jnlp 文件
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="appletContainer.jnlp">
<information>
<title>applet Container</title>
<vendor>MT</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se" download="eager"/>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" download="eager"/>
<jar href=myapplet.jar" download="eager"/>
</resources>
<applet-desc
name="Applet Container"
main-class="mt.common.util.applet.AppletContainer"
width="200"
height="300">
</applet-desc>
<update check="always"/>
</jnlp>
最佳答案
我认为您的小程序基本代码中可能有错误
关于java小程序在chrome中不可见但在FF中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21510431/