T SoVz :
This is currently the code that I have so far...
int nums = 8;
for (int j = 0; j < nums; j++) {
TextField test = new TextField();
test.setAlignment(Pos.CENTER);
}
this.getChildren().add(test);
I have tried doing somehting like TextField 'test' + j = new TextField(); so that it would create test1, test2, test3 ect. but that gave syntax errors. Not really sure on how I would go about this in any other way.
Dustin R :
Add them to something that allows them to stack vertically. Also, make sure your call to add them is inside the loop where test
is still in scope.
VBox box = new VBox(5);
int nums = 8;
for (int j = 0; j < nums; j++) {
TextField test = new TextField();
test.setAlignment(Pos.CENTER);
box.getChildren().add(test);
}
this.getChildren().add(box);