public void updateGrid(final boolean[][] grid)
  {
    if (lifeGrid != null)
    {
      Graphics g = lifeGrid.createGraphics();

        g.setColor(Color.WHITE);
        g.fillRect(0, 0, width, height);
        
      g.dispose();

      for (int y = 0; y < height; y++)
      {
        for (int x = 0; x < width; x++)
        {
          if (grid[y][x])
            lifeGrid.setRGB(x, y, BLACK);
        }
      }
    }
  }