title: JProgressBar update not working
body: <p>I have some code that moves files around and would like to implement a progress indicator while the files are being copied, but I'm having problems getting the progress bar to update - it just stays at 0.  Here is the relevant code in question:</p>
  
  <pre><code>            public class SomeClass extends JFrame implements ActionListener
              {
                  private static SomeClass myprogram = new SomeClass();
                  private JProgressBar progressBar = new JProgressBar();
  
                  public static void main(String[] args)
                  {
                      javax.swing.SwingUtilities.invokeLater(new Runnable() {
                          public void run()
                          {
                              myprogram.initGUI();
                          }
                      });
                  }
  
                  private void initGUI()
                  {
                      JButton button1 = new JButton("Another Button");
                      JButton button2 = new JButton("Copy");
                      // other GUI Code
                  }
  
                  @Override
                  public void actionPerformed(ActionEvent e)
                  {       
                      JButton button = (JButton) e.getSource();
                      String text = button.getText();
  
                      if (text.equalsIgnoreCase("Copy"))
                      {           
                          copyFiles();
                      }
                      else
                      {           
                          doSomethingElse();
                      }
                  }
  
                  public void copyFiles()
                  {       
                      for (int i = 0; i &lt; someNumber; i++)
                      {
                          //Code to copy files
                          progressBar.setValue((i * 100) / someNumber);
                      }
  
                  }
              }
  </code></pre>
  
  <p>Do I need to use SwingWorker to get this working properly?  Thanks for any help.</p>