// Program 12.3: A blinking rectangle
import java.applet.Applet;    
import java.awt.Graphics; 

public class Blink extends Applet {

  public void paint(Graphics g) {

    int AppletHeight = size().height;
    int AppletWidth = size().width;
    int RectHeight = AppletHeight/3;
    int RectWidth = AppletWidth/3;
    int RectTop = (AppletHeight - RectHeight)/2;
    int RectLeft= (AppletWidth - RectWidth)/2;

	for (int i=0; i < 1000; i++) {
      g.fillRect(RectTop, RectLeft, RectWidth-1, RectHeight-1);
      g.clearRect(RectTop, RectLeft, RectWidth-1, 
        RectHeight-1);
    }
    
  }

}
