Not sure if this is even remotely possible, but...
I have a jFrame with 10 different Textfields. Elequently named tf1, tf2, tf3...
What I'd LOVE to do is be able to reference them dynamically. Something like:
int i = 1;
while (i<11) {
tf[i].settext("blah - " + i);
}
Any ideas? If anybody knows of a working example it'd be great.
I can work with arrays (ie: String, int, doubles...),- so why would an Array of JTextFields be any different?are you talking about creating an array of textFields at runtime- well if you want to work with an array (of any type) then you need to create the Array. So you create the Array, use a loop to create the text field and add the text field to the Array and the panel.