N
Newbie
can some kind soul please help me out here?
I want to create 12 JTextFields.
I could of course write all 12 seperately like:
JTextField display1 = new JTextField();
JTextField display2 = new JTextField();
...
...
JTextField display12 = new JTextField();
Is there a way I can do this dynamically in a 'for loop'?
I have tried this, but it doesnt seem to work as I hoped for:
for (int x=0; x < 12; x++)
{
JTextField display+x = new JTextField();
}
Is there a way around what I would like to achieve?
thankyou!
I want to create 12 JTextFields.
I could of course write all 12 seperately like:
JTextField display1 = new JTextField();
JTextField display2 = new JTextField();
...
...
JTextField display12 = new JTextField();
Is there a way I can do this dynamically in a 'for loop'?
I have tried this, but it doesnt seem to work as I hoped for:
for (int x=0; x < 12; x++)
{
JTextField display+x = new JTextField();
}
Is there a way around what I would like to achieve?
thankyou!