下面是一个Applet程序,其功能是在窗口中绘制3个半径递增的圆,并用RGB三原色对这 3个圆填充。要求建立一个绘制圆的类,实现根据指定颜色进行填充的功能,在主程序中通过调用这个类的方法实现圆的绘制。请改正程序中的错误(有下画线的语句),使程序能输出正确的结果。 注意:不改动程序的结构,不得增行或删行。 import java.applet.*; import java.awt.*; import java.awt.*; /* <applet code='ex15_3.class'width=800 height=400> </applet> */ class CanvasCircle extends Canvas{ private Color cCircle; public CanvasCircle(Color c){ cCircle=c; } public void paint(Graphics g){ int dimCircle,xCircle,yCircle; Dimension sizeCurrent=getSize(); if(sizeCurrent.width>sizeCurrent.height){ dimCircle=sizeCurrent.width; } else{ dimCircle=sizeCurrent.height; } g.setColor(cCircle); xCircle=(sizeCurrent.heighe-dimCircle)/2; yCircle=(sizeCurrent.width-dimCircle)/2; g.fillOval(xCircle,yCircle,dimCircle,dimCircle); } } public class exl5_3 extends Applet{ public void init(){ GridBagLayout gbl=new GddBagLayout(); GridBagConstraints gbc=new CridBagConstraints(); CanvasCircle circleNew; setLayout(gbl); gbc.weightx=1.0; gbc.weighty=1.0; gbc.fill=GridBagConstraints.BOTH; circleNew=new CanvasCircle(Color.red); gbl.setConstraints(circleNew,gbc); add(circleNeW); gbc.weightx=1.5; gbc.weighty=1.5; circleNew=new CanvasCircle(Color.green); gbl.sctConstraints(eircleNew,gbc); add(circleNew); gbc.weightx=2.0; gbc.weighty=2.0; circleNew=new CanvasCircle(Color.blue); gbl.setConstraints(circleNew,gbc); add(circleNew); } } ex15_3.html <HTML> <HEAD> <TITLE>ex15_3</TITLE> </HEAD> <BODY> <applet code='ex15_3.class'width=800 height=400> </applet> </BODY> </HTMI>