title: Update JProgressBar
body: <p>I can't update my progressbar... this is my code</p>
  
  <pre><code>Thread t=new Thread(new Runnable(){
          public void run(){
              int i=1;
              jProgBar.setMinimum(0);
              jProgBar.setMaximum(100);
              try {
                  while(i&lt;=100 || true){
                      jProgBar.setValue(i);
                      i++;
                      Thread.sleep(50);
                  }
              }
              catch (InterruptedException ex){
                  jProgBar.setValue(jProgBar.getMaximum());
              }
          }
      });
      t.start();
  
      .... Something code that correctly works
  
      t.interrupt();
  </code></pre>
  
  <p>The progress bar state is updated only at the end of thread.
  Can someone help me??</p>