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
Post a Comment