title: JProgressBar not updating
body: <p>I have made a very simple code to show it here, i have a button that should show a JDialog to check the progress status, i am using the invoke late to go through EDT and my loop isn't in the run method, so why isn't my bar updating ?
  here is the code</p>
  
  <pre><code>import javax.swing.JButton;
  import javax.swing.JDialog;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.JProgressBar;
  import javax.swing.JTextField;
  import javax.swing.SwingUtilities;
  
  import java.awt.BorderLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  public class JBarEx extends JFrame {
  private JTextField progStatus = new JTextField("Undefined");
  private JButton dialogBtn = new JButton("Show Progression dialog");
  final JDialog dlg = new JDialog((JFrame) null, "prog Title", false);
  final JProgressBar dpb = new JProgressBar(0, 100);
  
  public JBarEx() {
      JPanel pan = new JPanel();
      dialogBtn.addActionListener(new ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent e) {
              // TODO Auto-generated method stub
              showProgress();
          }
      });
      progStatus.setEditable(false);
      pan.add(progStatus);
      pan.add(dialogBtn);
      setContentPane(pan);
      this.setSize(200, 100);
      setVisible(true);
  }
  
  public void showProgress() {
      dlg.add(BorderLayout.CENTER, dpb);
      dlg.add(BorderLayout.NORTH, new JLabel("prog message"));
      dlg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
      dlg.setSize(300, 75);
      dlg.setLocationRelativeTo(null);
      dlg.setVisible(true);
  
      for (int i = 0; i &lt; 100; i++) {
          final int ii = i;
          try {
              Thread.sleep(25);
              SwingUtilities.invokeLater(new Runnable() {
  
                  @Override
                  public void run() {
                      updateBar(ii);
  
                  }
              });
          }
          catch (InterruptedException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  
  }
  
  public void updateBar(int newValue) {
      dpb.setValue(newValue);
  }
  
  public static void main(String[] args) {
      JBarEx jbx = new JBarEx();
  }
  </code></pre>
  
  <p>}</p>