Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Column is a vertical line and row is a horizontal line
- //Two FOR loops used for creating 2D array of buttons with values i,j
- for(int i=0; i<btn.length; i++){
- for(int j=0; j<btn.length;j++){
- //Initializing 2D buttons with values i,j
- btn[i][j] = new Button(""+i+","+""+j);
- btn[i][j].setPrefSize(50, 50);
- // Adding button to GridPane, i representing column value, j repsrenting row value.
- gridPane.add(btn[i][j], i, j);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment