I
IKerr.
Hi,
I have some code which declares a whole bunch of text fields individually,
ie
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField()
etc .....
how can I iterate over them ? What I want to do is something like:
String[] customerDetails = new String[19];
for(int i = 0; i<customerDetails.length;i++){
customerDetails = jTextField+i.getText();
}
This is a bit simplified because there beans on the page which inheret from
JTextField, and comboboxes which I also want to grab text from, but rather
than having to rewrite a whole load of code to make a JTextField[] or to
issue individual getText()s I was wondering if there was a way of iterating
over what I have ?
thanks
Iain
I have some code which declares a whole bunch of text fields individually,
ie
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField()
etc .....
how can I iterate over them ? What I want to do is something like:
String[] customerDetails = new String[19];
for(int i = 0; i<customerDetails.length;i++){
customerDetails = jTextField+i.getText();
}
This is a bit simplified because there beans on the page which inheret from
JTextField, and comboboxes which I also want to grab text from, but rather
than having to rewrite a whole load of code to make a JTextField[] or to
issue individual getText()s I was wondering if there was a way of iterating
over what I have ?
thanks
Iain