import java.awt.*;
import java.applet.*;

public class Rect4 extends Applet {

  int shape;

  public void init() {
    shape=0;
  }

  public void paint (Graphics g)
  {
    int x0, y0;  // Mittelpunkt
    int x, y;      // Mittelpunkt  links / oben
    int w, h;     // Breite Höhe
    int diff;
    x0 = 150;
    y0 = 150;
    diff = 10;
    w = 50;
    h = 50;

    g.setColor(Color.blue);
    for (int i=0; i<10; i++) {
      g.drawRect(x0,y0,w,h);
      x0 -= diff;
      y0 -= diff;
      h += diff << 1;  //SHL 1;
      w += diff*2;
      g.setColor(Color.red);
    }  // for

  }




    /**
     * Stop the insanity, um, applet.
     */
    public synchronized void stop() {
    }


    public String getAppletInfo() {
        return "A simple drawing program.";
    }

    public static void main(String args[]) {
      Frame f = new Frame("Rect4");
     	Rect4 rect = new Rect4();
    	rect.init();
    	rect.start();
      f.add("Center", rect);
     	f.setSize(500,400);
    	f.show();
    }


}



