arrays - How to dynamically access textfields in Java? -


we have little problem accessing textfield-s.

we have list of 81 (yes 81) textfields

private textfield textfield1 = new textfield();  private textfield textfield2 = new textfield();  private textfield textfield3 = new textfield();  ... 

now want text these fields , store them in array.

for loop    data[i] = textfield???.gettext(); 

how incorporate changing number i field name?

would appreciate or ideas.

the easiest way add textfield objects arraylist , loop through list calling gettext() on each field.


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -