Hi guys hope some one can help, i have an application,where by when u click a button a loop is executed, below is the code for the loop
progress is a progress bar, what should happen is that the value of progress bar should imcremtent, when the loop is executed, and the progress bar should seem as though it is progressing. scanOutput is a jlabel which should display the value i. What seems to happen is that nothing is updated as the loop is being executed, only when the loop has finished, then the updates are shown. I hope you understand, if not I can explain more. Please can some one help me. It should update as the loop is executed.Code:for (int i=staport; i<=stoport;i++) { progress.setValue(i); try { //a process happends here } catch (Exception e) {} scanOutPut.setText("<HTML>" + i +"<p></HTML>"); }


Reply With Quote


Bookmarks