另外两个文件是:
//ApplicationFrame.javaimport java.awt.*;
import java.awt.event.*;public class ApplicationFrame extends Frame{

public ApplicationFrame(){this("Application Frame v1.0");}

public ApplicationFrame(String title){
super(title);
creatUI();
}

protected void creatUI(){
setSize(500,400);
center();

addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
dispose();
System.exit(0);
}
});
}

public void center(){
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = getSize();
int x = (screenSize.width - frameSize.width)/2;
int y = (screenSize.height - frameSize.height)/2;
setLocation(x,y);
}
}
//*************************************//DrawPixel.javaimport java.awt.*;
import java.awt.geom.*;public class DrawPixel{

public DrawPixel(){}; public DrawPixel(Graphics2D g2,int x,int y,Color c){
g2.setPaint(c);
Point2D point = new Point2D.Double();
Line2D line = new Line2D.Double();

point.setLocation(x,y);
line.setLine(point,point);
g2.draw(line);
} public void putPixel(Graphics2D g2,double x,double y,Color c){
g2.setPaint(c);
Point2D point = new Point2D.Double();
Line2D line = new Line2D.Double();

point.setLocation(x,y);
line.setLine(point,point);
g2.draw(line);
    
}
}
//**************************************代码已经贴完,写得不行的地方希望大家指点。

解决方案 »

  1.   

    public Circle(){
    Circle c = new Circle();
    这里死循环了,栈不溢出才怪呢
    要用对象this就行了嘛
      

  2.   

    就是,楼主在Circle的构造函数中写“Circle c = new Circle();”
    这一句是什么意思?
      

  3.   

    同意
    jFresH_MaN()(AbsolutelyFresh)(java欣人) ( )
      

  4.   

    StackOverflowError这个错误~~
    大部分情况下 是由于死循环导致~
    c++如此,java也不例外。