gpt4 book ai didi

java - 无法在网络浏览器中运行小程序程序,但在小程序查看器中运行正常?

转载 作者:行者123 更新时间:2023-12-01 05:05:33 26 4
gpt4 key购买 nike

applet 程序运行良好,applet 查看器但是当尝试在浏览器中运行时,它显示运行时异常 java.lang.reflect.InvocationException 并且窗口显示以下详细信息

    Java Plug-in 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) Client VM
User home directory = C:\Users\tom
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
-----------------------------------------
-----------

这是我运行小程序的 html 代码

    <html>
<body>
<applet code="integrity.class" width="800" height="500">
</applet>
</body>
</html>

帮我解决这个问题!!

最佳答案

您应该将包路径上的代码设置为小程序类,并将存档设置为 jar 的路径,如下所示:

<applet code="my.applet.package.Integrity" archive="integrity.jar" width="800" height="500">

另请注意,Java 中的类名应以大写字母开头

关于java - 无法在网络浏览器中运行小程序程序,但在小程序查看器中运行正常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12740395/

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