Zookey90

Untitled

May 13th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //Column is a vertical line and row is a horizontal line
  2. //Two FOR loops used for creating 2D array of buttons with values i,j
  3. for(int i=0; i<btn.length; i++){
  4. for(int j=0; j<btn.length;j++){
  5. //Initializing 2D buttons with values i,j
  6. btn[i][j] = new Button(""+i+","+""+j);
  7. btn[i][j].setPrefSize(50, 50);
  8. // Adding button to GridPane, i representing column value, j repsrenting row value.
  9. gridPane.add(btn[i][j], i, j);
  10.  
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment