I know I can add Text
or Node
inside GridPane
with the Following code
Text text = new Text("Hello World");
gridPane.add(text, row, column);
But I have AnchorPane
inside every rows
and columns
of GridPane
which is manually inserted by the help of SceneBuilder
, inside the AnchorPane
I want to add the Text
. Something like getting the children of GridPane
and add the Text
on it.
I do it like this but it doesn't work:
for(int i = 0; i < row; i++){
for(int j = 0; j < column; j++){
Text text = new Text("Hello World!");
gridPane.getChildren().add(text);
}
}