import java.awt.*;
import javax.swing.*;
import java.util.Random;
/*
<applet code="RectRand" width=200 height=200>
</applet>
 */
/**
 * Class RectRand 
 * 
 * @author smh 
 * @version 1
 */
public class RectRand extends JApplet
{
    private int x, y;
    private int xsize = 15, ysize = 15;
    private int screenWidth, screenHeight;
    private Random gen = new Random();


    public void init()
    { 
        //JRootPane rootPane = this.getRootPane();    
        //rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
    
        screenWidth = getWidth();
        screenHeight = getHeight();
        setBackground(Color.blue);
        
    }

 
    public void start()
    {   }

 
    public void stop()
    {   }


    public void paint(Graphics g)
    {
        x = gen.nextInt(screenWidth - xsize);
        y = gen.nextInt(screenHeight - ysize);
      
        g.fillRect(x, y, xsize, ysize);
    }


    public void destroy()
    {   }

}