
每个点盯裂都是一个对象,这个对象有自己的方向属性,移动高则大行为
class MovePoint{
private static final int WEST = 1;
....
protected int x;
protected int y;
protected int oreint;//戚竖方向
protected int speed;
public MovePoint(....){....}
public void move(int oreint){...}
private class Moving implements Runnable{...}//执行move方法
}
class Rectangle extends JFrame{
....
}
看《java Swing 标准教程》很好。