我用Applet开发了一个JSP web应用程序。我无法从我的JSP页面显示小程序。无法显示Applet
下面是代码:
<applet codebase="http://localhost:8080/av_applet_jsp/applets" code="av_app.class" WIDTH="200" HEIGHT="100">
av_app.class
位于内Webcontent/applets/
在哪里,我错了?
这里是我的Applet类:
public class av_app extends Applet {
@Override
public void paint(Graphics g) {
int inset;
int rectWidth, rectHeight;
g.setColor(Color.pink);
g.fillRect(0,0,300,160);
g.setColor(Color.green);
inset = 0;
rectWidth = 299;
rectHeight = 159;
while (rectWidth >= 0 && rectHeight >= 0) {
g.drawRect(inset, inset, rectWidth, rectHeight);
inset += 15;
rectWidth -= 30;
rectHeight -= 30;
}
}
}
我能够使用小程序观众看到小程序。我在JSP页面中做错了什么?
当我试图an example code它的工作:
<applet codebase="http://java.sun.com/applets/NervousText/1.1"
code="NervousText.class" width=400 height=75>
<param name="text" value="Welcome to HotJava!">
</applet>
我的课程位于“http:// localhost:8080/av_applet_jsp/applets/av_app.class” – evan 2010-10-25 06:24:10