Version 3

No visible changes in the appearance of the applet. What I've done here is added the init method to set the contents of the array, and modified the print method to just display the array. Before, the paint method did both of these things.

Top     Version 2     Version 4    

Source code:

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

public class Life extends Applet
{
  final int boardSize = 10;
  final int cellSize = 20;
  boolean[][] board = new boolean[boardSize][boardSize];

  public void init ()
  {
    for (int i = 0; i < boardSize; i++)
      for (int j = 0; j < boardSize; j++)
        board[i][j] = (i + j) % 3 == 0; // diagonal pattern
  }
        
  public void paint (Graphics g)
  {
    for (int i = 0; i < boardSize; i++) {
      for (int j = 0; j < boardSize; j++) {
        if (board[i][j])
	  g.setColor (Color.blue);
	else
	  g.setColor (Color.white);
	g.fillOval (i * cellSize, j * cellSize, cellSize, cellSize);
      }
    }
  }
}