
import java.awt.*;
import javax.swing.*;

/**
 * Class Circles2 
 * 
 * @author smh 
 * @version 1
 * @date 2011 - 03 - 14
 */
public class Circles2 extends JApplet
{
   
    int height;
    int width;
    int diameter;
    Color[] colors= new Color[] {Color.red, Color.orange, Color.yellow, 
                            Color.green, Color.blue, Color.magenta};

    public void init()
    {
        //JRootPane rootPane = this.getRootPane();    
        //rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
        
       height = getHeight();       // Component methods to get size of drawing surface
       width = getWidth();
       diameter = Math.min(height, width) / 10;
       setBackground(Color.gray);
    }


    public void start()
    {   }


    public void stop()
    {   }


    public void paint(Graphics g)
    {
              
        for (int i = 0, x = width-diameter, y= 0; 
            i <10 && x >= 0 && y <= height-diameter; 
            i++, x -= diameter, y += diameter)              // u gotta prob with , ?
        {
            g.setColor(colors[ i % colors.length ]);        // wrap around available colors
            g.fillOval(x, y, diameter, diameter);
        }
       
    }

    public void destroy()
    { }

}