问题描述
请教大虾们,为什么不能画出圆……附:jsp文件:pluginTest.jsp<%@pagelanguage="java"contentType="text/html;charset=GBK"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><title>用plugin加载Applet</title><head><metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1"><title>Inserttitlehere</title></head><body><center>实现画圆功能</center><br><hr><br><center><!--用plugin加载Applet--><jsp:plugintype="applet"code="CircleApplet.class"width="100"height="100"align="center"><jsp:params><jsp:paramname="radius"value="30"/><jsp:paramname="color"value="0xff0000"/></jsp:params><jsp:fallback>无法加载Applet</jsp:fallback></jsp:plugin></center></body></html>java类:CircleApplet.javaimportjava.applet.Applet;importjava.awt.Graphics;importjava.awt.Color;publicclassCircleAppletextendsApplet{privateColorthecolor=null;privateintradius=5;publicvoidinit(){thecolor=Color.decode(this.getParameter("color"));radius=Integer.parseInt(this.getParameter("radius"));}publicvoidpaint(Graphicsg){g.setColor(thecolor);g.fillOval(10,10,radius*2,radius*2);}}