import java.awt.*;
import javax.swing.*;
public class MyPanel extends JPanel{
RectClass rectClass = null;
public MyPanel(){
rectClass = RectClass.returnRectClass();
}
public void paint(Graphics g){
super.paint(g);
this.drawRect(rectClass.getX(), rectClass.getY(), rectClass.getWidth(), rectClass.getHeight(), g);
}
public void drawRect(int x1, int y1, int x2, int y2,Graphics g){
g.fillRect(x1, y1, x2, y2);
this.repaint();
}
//创建MyPanel对象,return函数方便其他函数调用。
private static MyPanel mypanel = new MyPanel();
public static MyPane