public class ex2 extends Frame{
public Rect r1;
public Rect r2;
public ColoredRect r3;public static void main(String[] args){
ex2 ex=new ex2();
ex.r1=new Rect(1,1,4,4);
ex.r2=new Rect(2,3,5,6);
ex.r3=new ColoredRect(1,100,200,200,Color.yellow,Color.black);
ex.setSize(300,300);
ex.setVisible(true);
ex.repaint();
}public void paint(Graphics g){
r3.draw(g);
}
}
public Rect r1;
public Rect r2;
public ColoredRect r3;public static void main(String[] args){
ex2 ex=new ex2();
ex.r1=new Rect(1,1,4,4);
ex.r2=new Rect(2,3,5,6);
ex.r3=new ColoredRect(1,100,200,200,Color.yellow,Color.black);
ex.setSize(300,300);
ex.setVisible(true);
ex.repaint();
}public void paint(Graphics g){
r3.draw(g);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货