java - GUI - Display lines one by one on a JTextPane and make a related JProgressBar -


how display lines 1 one on jtextpane , make related jprogressbar?

i have loop:

  int k;   (k=0; k<array_txt.length; k++) {     if (array_txt[k] != null) {        textpane.append( array_txt[k] );     }  } 

i'd append every line array_txt[k] (string) on jtextpane 1 one after few seconds , has synchronized jprogressbar.

in way every time k has different value print on text pane , progress bar related prints.

i have read thread.sleep(x); don't know put in order reach aim.

don't block edt (event dispatch thread) - gui 'freeze' when happens. instead of calling thread.sleep(n) implement swing timer repeating tasks or swingworker long running tasks. see concurrency in swing more details.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -