Zookey90

2forloops

May 10th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. for(int i=0; i<btn.length; i++){
  2. for(int j=0; j<btn.length;j++){
  3.  
  4. //Initializing 2D buttons with values i,j
  5. btn[i][j] = new Button(""+i+","+""+j);
  6. btn[i][j].setPrefSize(50, 50); // Set pref size to buttons
  7. gridPane.add(btn[i][j], i, j); // Adding button to GridPane
  8.  
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment