title: Progress Bar with Thread (Java Swing)
body: <p>Here is a little a example:</p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
          int x = 0;
          while (jProgressBar1.getValue() &lt; 100) {
              try {
                  Thread.sleep(50);
                  x++;
                  jProgressBar1.setValue(x);
                  jProgressBar1.repaint();
              } catch (InterruptedException ex) {
                  Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
              }
              System.out.println(jProgressBar1.getValue());
          }
      }
  </code></pre>
  
  <p><code>System.out.println(jProgressBar1.getValue());</code> returns digits to IDE output, but jProgressBar1 doesn't draw this value. What's wrong with this code? Please help. </p>