I've got a problem with my simulation of processor counter in java. I want to counting for example from 0 to 6 and show current values of counting (0, 1, 2, 3, 4, 5, 6) in Text field. When I click "Count" button, my program freezes for a moment and after counting in Text field I can see only number 6. I want to see other numbers during the counting. Here is part of my code:
for (int b=0; b<30; b++)
{
counter2.Count();
try {
Thread.sleep(300);
} catch(InterruptedException e){}
text6.setText("TEST" + counter2.MainReg); }
What can I do with it? Thank you for helping me.