您好我已经尝试了以下代码
索引.jsp
<applet code="com.applet.PrintApplet" codebase ="TestApplet.jar" width="320" height="120"></applet>
java 类PrintApplet.java
import java.applet.Applet;
import java.awt.Color;
public class PrintApplet extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}
当此应用程序在浏览器中运行时
类未找到异常被触发..
但我在浏览器中有问题
错误,例如带有三个按钮的弹出框
细节忽略并重新加载
Application error
classNotFoundException
com.applet.printApplet
详细信息按钮
Java Plug-in 10.21.2.11
Using JRE version 1.7.0_21-b11 Java HotSpot(TM) Client VM
User home directory = C:\Users\Helthcare2
----------------------------------------------------
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>
----------------------------------------------------
我也在构建路径中添加了 jar 文件。