我已经开发了 Java Applet 应用程序,但在部署时遇到问题。应用程序在 Eclipse 中成功编译。我将应用程序导出为 JAR 文件。我创建了 HTML 文件并将以下内容放入其中:
<html>
<title>The Hello, World Applet</title>
<body>
<hr>
<applet code="Applet.class" width="100%" height="100%" archive="Clijent.jar" >
<
</applet>
<hr>
</body>
</html>
当我使用网络浏览器启动小程序时,出现以下错误。
我成功地在 Eclipse 项目中找到该类,并将其添加到构建路径中。问题出在哪里?
最佳答案
添加 SwingX swingx.jar
到 Applet 标记中 Applet 的 archive
属性中的类列表,以便将其包含在类路径中
<applet code="Applet.class" width="100%" height="100%" archive="Clijent.jar,swingx.jar" >
关于Java Applet 无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18827302/