
import java.awt.*;

public class example2 extends BufferedApplet
{
   int w = 0, h = 0;
   Font font = new Font("Helvetica", Font.BOLD, 48);

   int mx = 0, my = 0;

   public void render(Graphics g) {
      if (w == 0) {
	 w = bounds().width;
	 h = bounds().height;

         mx = w/2;
         my = h/2;
      }

      g.setColor(Color.white);
      g.fillRect(0, 0, w, h);

      g.setColor(Color.red);
      g.fillRect(mx - w/6, my - h/6, w/3, h/3);

      g.setColor(Color.black);
      g.fillOval(mx - w/6, my - h/6, w/3, h/3);
   }

   public boolean mouseMove(Event e, int x, int y) {
      mx = x;
      my = y;
      damage = true;
      return true;
   }
}


