CS1 Standard Demo Page

The following text was written to the standard output stream when the Stella program was executed from Netbeans.

/*
 * Stella
 */
package npw;
import java.awt.Color;
import java.util.Random;
import javax.swing.JOptionPane;
import painter.SPainter;
import shapes.SSquare;

/**
 *
 * @author dmaslows
 */
public class Stella {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        SPainter me = new SPainter("Stella",800,800);
        String command = JOptionPane.showInputDialog(null,"Command?");
        int sideLength = 700;
        int decrement = (sideLength/Integer.parseInt(command));
        Color a = randomColor();
        Color b = randomColor();
        SSquare s = new SSquare(sideLength);
        int i = 1;
        while ( s.side() > 0) {
            if (i%2 == 1){
                me.setColor(a);
            }
            else {
                me.setColor(b);
            }
            me.paint(s);
            s.shrink(decrement);
            i=i+1;
        }

        
       
    }
    private static Color randomColor() {
        Random rgen = new Random();
        int r = rgen.nextInt(256);
        int g = rgen.nextInt(256);
        int b = rgen.nextInt(256);  
        return new Color(r,b,g);
    }
}