I am new to this, and a little slow. I am building a BoardGameTester, connect four, TicTacToe, Mastermind. Please help me. Thanks for your time.

This is the error I receive.

Code:
run:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
at games.board.Board.<init>(Board.java:21)
at BoardGameTester.main(BoardGameTester.java:22)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

Here is the main.

Code:
import games.board.Board;
import games.board.Cell;
import games.board.Mark;



public class BoardGameTester {

/**
* @param args
*/
private static Board tttgameboard, mmgameboard, cfgameboard ;
public static void main(String[] args) {
// TODO Auto-generated method stub
// 3x3 board for TicTacToe
@SuppressWarnings("LocalVariableHidesMemberVariabl e")
Board tttgameboard;
tttgameboard = new Board(3,3);

// 6x7 board for Connect Four
Board cfgameboard;
cfgameboard = new Board (6,7);

// 5x8 board for MasterMind; blue mark
Board mmgameboard = new Board (5,8);

System.out.println (" Tic Tac Toe game board ");
tttgameboard.setCell(Mark.NOUGHT,1,1);
System.out.println(tttgameboard.toString());

System.out.println(" Connect Four game board ");
cfgameboard.setCell(Mark.YELLOW,0,0);
System.out.println(cfgameboard.toString());

System.out.println (" Mastermind game board ");
mmgameboard.setCell(Mark.BLUE,0,0);
System.out.println(mmgameboard.toString());

class Board {
private Cell[][] cells;

public Board(int rows, int columns) {
cells = new Cell[rows][columns];
int r = 0;
int c = 0;
for (int r1 = 0; r1 < cells[c].length; r1++) { // taking out [0]; replacing [0] w/ [c]
for (int c1 = r; c1 < cells[r1].length; c1++) { //taking out [1]; replacing [1] w/ [r]
cells [r1][c1] = new Cell (r1,c1);

}
}
}



}
}
public static Board getTttgameboard() {
return tttgameboard;
}
public static void setTttgameboard(Board tttgameboard) {
BoardGameTester.tttgameboard = tttgameboard;
}
public static Board getMmgameboard() {
return mmgameboard;
}
public static void setMmgameboard(Board mmgameboard) {
BoardGameTester.mmgameboard = mmgameboard;
}
public static Board getCfgameboard() {
return cfgameboard;
}
public static void setCfgameboard(Board cfgameboard) {
BoardGameTester.cfgameboard = cfgameboard;
}
}
here is the Board.

Code:
package games.board;

import java.awt.GridLayout;
import java.awt.event.ActionListener;
import javax.swing.JPanel;



@SuppressWarnings("unused")
public class Board extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
@SuppressWarnings("FieldMayBeFinal")
private Cell[][] cells;
public Board(int rows, int columns) {
cells = new Cell[rows][columns];
for( int r = 0; r < cells[0].length; r++ ) {
for (int c = 0; c < cells[1].length; c++) {
cells[r][c] = new Cell(r,c);
}
}
}
public Board(int rows, int columns, ActionListener ah) {
cells = new Cell[rows][columns];
this.setLayout(new GridLayout());
for( int r = 0; r < cells.length; r++ ) {
for (int c = 0; c < cells[r].length; c++) {
cells[r][c] = new Cell(r,c);
this.add(cells[r][c]);
cells[r][c].addActionListener(ah);
}
}
}
private void add(Cell cell) {
// TODO Auto-generated method stub

}
public void setCell(Mark mark, int row, int column) throws
IllegalArgumentException {
if (cells[row][column].getContent() == Mark.EMPTY)
cells[row][column].setContent(mark);
else throw new IllegalArgumentException("Player already there!");
}
public Cell getCell(int row, int column) {
return cells[row][column];
}
@Override
public String toString() {
StringBuilder str = new StringBuilder();
for (Cell[] cell : cells) {
str.append("|");
for (Cell cell1 : cell) {
switch (cell1.getContent()) {
case NOUGHT:
str.append("O");
break;
case CROSS:
str.append("X");
break;
case YELLOW:
str.append("Y");
break;
case RED:
str.append("R");
break;
case BLUE:
str.append("B");
break;
case GREEN:
str.append("G");
break;
case MAGENTA:
str.append("M");
break;
case ORANGE:
str.append("M");
break;
default: //Empty
str.append("");
}
str.append("|");
}
str.append("\n");
}
return str.toString();

}

}