我正在使用其中包含摆动组件的 JApplet,并且事件处理由 AWT 侦听器完成。当我在小程序查看器中运行它时,我的小程序很好,但是当我在浏览器中运行它时,它不会只显示和空白空间,顶部有消息:
Error, Click for details
问题可能出在哪里,我该如何解决?
堆栈跟踪是:
java.lang.ClassNotFoundException: AudioApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
这是我用来将我的小程序嵌入 HTML 的小程序标签
<applet code="AudioApplet.class" width="700" height="700">
Java applet that draws animated bubbles.
</applet>