Java: Cannot print the value of textbox in loop
<p>i have 3 textboxes. One textbox contains the some integer, eg:2 What i want to do is i want to iterate the loop 2 times.. in every iteration i want to print the value in textboxes. I am clearing the textbox before going to the next iteration. After 2 iterations i want to make the textboxes editable false. But the problem is the loop iterates 2 times but the value in textbox is printed only for the 1st iteration. I wrote the following code</p>

<pre><code>int i=1;
do
{
System.out.println(ext_people_name.getText());
System.out.println(ext_contact_num.getText());
System.out.println(i);
ext_people_name.setText("");
ext_contact_num.setText("");
i++;
if(i&gt;nop1)
{
ext_people_name.setEditable(false); 
ext_contact_num.setEditable(false); 
break;
}
}while(i&lt;=nop1); 
</code></pre>

<p>The output i get right now is</p>

<pre><code>neha
8798
1
2
</code></pre>

<p>Can anyone tell any alternative to this or please help</p>
