gpt4 book ai didi

Java Applet 在 Netbeans 中运行,但不会在浏览器中运行

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

我使用 Netbeans 创建了一个 Java 小程序。它是一个 GUI 横幅创建器。它在 Netbeans applet 查看器中运行良好,但当我使用 HTML 加载它时,出现错误。它正在查找类文件,但随后我得到:

org/jdesktop/beansbinding/Property
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3136)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at sun.plugin2.applet.Plugin2Manager$13.run(Plugin2Manager.java:3060)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.beansbinding.Property
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:249)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:179)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 20 more
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property

我读过一些地方,我需要右键单击我的项目,然后转到库。一旦我到达那里,我就安装了 Beans Binding Library。还有其他地方安装了 beans.jar 文件(我有)。

如何解决这个运行时异常?

最佳答案

Caused by: java.lang.NoClassDefFoundError: org/jdesktop/beansbinding/Property

将包含 org.jdesktop.beansbinding.Property 类的 Jar 添加到 applet 元素的 archive 属性。

关于Java Applet 在 Netbeans 中运行,但不会在浏览器中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9333250/

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