import java.applet.*;
import java.awt.*;
import java.awt.event.*;
class Mycanvas extends Canvas
{
int x,y,r;
int red,green,blue;
Mycanvas()
{
setSize(100,100);
setBackground(Color.CYAN);
}
public void setX(int x)
{
this.x=x;
}
public void setY(int y)
{
this.y=y;
}
public void setR(int r)
{
this.r=r;
}
public void paint(Graphics g)
{
g.drawOval(x,y,2*r,2*r);
}
}
public class Example11_4 extends Applet implements ActionListener
{
Mycanvas canvas;
TextField inputR,inputX,inputY;
Button b;
public void init()
{
canvas=new Mycanvas();
inputR=new TextField(6);
inputX=new TextField(6);
inputY=new TextField(6);
add(new Label("input the circle locate: "));
add(inputX);
add(inputY);
add(new Label("input the banjing: "));
add(inputR);
b=new Button("sure");
b.addActionListener(this);
add(b);
add(canvas);
}
public void actionPerformed(ActionEvent e)
{
int x,y,r;
try{
x=Integer.parseInt(inputX.getText());
y=Integer.parseInt(inputY.getText());
r=Integer.parseInt(inputR.getText());
canvas.setX(x);
canvas.setY(y);
canvas.setR(r);
canvas.repaint();
    }
catch(NumberFormatException ee)
{
x=0;y=0;r=0;
}
     }
}
谢谢指点
找对给分