swoop

2D Cell array

May 8th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1.     private Cell[][] cells;
  2.  
  3.     public GridPanel(Crossword c){
  4.         int size = c.size;
  5.         this.setLayout(new GridLayout(size,size));
  6.         cells = new Cell[size][size];
  7.         for(int i=0;i<size;i++){
  8.             for(int j=0;j<size;j++){
  9.                 Cell cell = new Cell();
  10.                 cells[i][j].add(cell);
  11.             }
  12.         }
  13.        
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment