当前位置: 代码迷 >> Java相关 >> [求助]一个不知道怎样解决的小程序
  详细解决方案

[求助]一个不知道怎样解决的小程序

热度:200   发布时间:2007-06-02 23:23:18.0
[求助]一个不知道怎样解决的小程序

import java.awt.*;
public class Rectangle{
public static void main(String args[]){
int x=3;
int y=4;
int width=17;
int height=18;
Rectangle r=new Rectangle(x,y,width,height);
System.out.print(""+r);
}
}

为什么不能运行???


----------------解决方案--------------------------------------------------------
Rectangle应该是画在Panel上的,不能输出.
----------------解决方案--------------------------------------------------------
也可以在继承在paint(graphics g) g.Recktangle(x,y,width,height)里面画 呵呵  
----------------解决方案--------------------------------------------------------
  相关解决方案