Is there a way to setText() on a group of say 10 textFields via a For loop? Let's say I want to setText() on all ten textFields to "0.0". Of course the long way to do so would be to write:
textField1.setText("0.0");
textField2.setText("0.0");
textField3.setText("0.0");
and so on all the way to ten. A person would be coding all day if there were 100 or even a 1000 textFields to update so I figured there must be an easier way using a loop. Obviously, the code below doesn't work but I thought it might give you an idea of what I'm trying to accomplish:
int numberOfTextFields = 10;
for (int i = 1; i <= numberOfTextFields; i++) {
textField.setText("0.0");
}
Any comments are greatly appreciated. Thanks for the help!