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

public class Clipping2 extends Applet {

   public void start()
   {
      setForeground ( Color.red );
      setBackground ( Color.white );
   }

   public void update ( Graphics g )
   {
      g.clipRect ( 20, 20, 160, 60 );
      g.setColor ( Color.blue );
      paint ( g );
   }

   public void paint ( Graphics g )
   {
      g.drawRect ( 20, 20, 160, 60 );      
      g.fillOval (  0, 60, 45, 45 );
      g.fillRect ( 80,  0, 120, 40 );
      g.drawLine ( 100, 100, 200, 60 );
      g.drawLine ( 90, 100, 200, 40 );
      g.drawString ( "Hallo, hier wird geclippt.", 0, 50 );
   }

   public boolean mouseDown ( Event e, int x, int y )
   {
      repaint();
      return true;
   }  
  
}
