none
settext function in a loop in java only shows the last one?? RRS feed

  • Question

  • i have a button in java that calls a function when clicked and that function works just fine but the for loop won't refresh the text area. Instead at the end of the function (after 10s) it only shows i = 10 in the text area. I just simply want the text area to refresh and show i at every second and replace the i. I do not want to show them all at once, just replace them;

    int i;

    for (i = 0; i<4; i++)

    {

    try

    input.setText("i = " + i);
    Thread.sleep(1000); // delay of 1.000 seconds 

    catch(InterruptedException e){}
    }

    Friday, November 15, 2013 2:21 PM

All replies

  • EmilioLopez,

    Sorry but you have posted to a forum that deals exclusively with questions/issues about customizing and programming Microsoft Project, a planning and scheduling application. I suggest you delete this post and find a forum that deals with C or Java programming.

    John

    Friday, November 15, 2013 4:16 PM