@Override
    public void run() {
        int xd = 1;
        int yd = 1;
        x = 0;
        y = 0;
        for (; ; ) {
            try {
                Thread.sleep(10);
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (x == (w - 20) || x < 0) {
                xd = -1 * xd;
            }
            if (y == (h - 20) || y < 0) {
                yd = -1 * yd;
            }
            if (xd == 1) {
                x++;
            } else {
                x--;
            }
            if (yd == 1) {
                y++;
            } else {
                y--;
            }
            // System.out.println(x + ", " + y);
        }
    }