title: JButton Action Listener progress bar, update without freezing?
body: <p>I've got a progress bar, when I strike the button, on the button listener I've got a progress bar that updates as something downloads. However, the GUI freezes until the download is complete.
  How can I get this progress bar to update as the download continues? However, if the download starts when the application is compiled without user interference, the download progresses as the progress bar updates. However, it's the complete opposite on JButton action listener.</p>
  
  <p>How can I use SwingWorker to get this to work?</p>
  
  <pre><code>while((i=in.read(data,0,1024))&gt;=0)
                      {
                      totalDataRead=totalDataRead+i;
                      bout.write(data,0,i);
                      float Percent=(totalDataRead*100)/filesize;
                      currentProgress.setValue((int)Percent);
  
                      float allP = Percent / 5;
                      all.setValue((int)allP);
  
                      }
  </code></pre>
  
  <p>This is only the loop (without catchException), how can I possibly get the GUI to update as it downloads, after the button listener?!</p>