Mehrdimensionale Felder

als Feld von (Feld von ...) Elementen

int size = 9;
Cell [][] brett = new Cell [size] [size];

public void init () {
  this.setLayout(new GridLayout(size,0));
  for (int row=0; row < size; row++) {
    for (int col=0; col < size; col++) {
      brett[row][col] = new Cell ();
      this.add ( brett[row][col].visual() );
    }
  }
}



Johannes Waldmann 2007-01-23