title: Set Progressbar from another class
body: <p>I'm trying to set my progressbar from another class but failed. This is my progressbar the class <code>Upload</code>.</p>
  
  <pre><code>JProgressBar progressBar = new JProgressBar();
  progressBar.setBounds(91, 134, 284, 17);
  frame.getContentPane().add(progressBar);
  </code></pre>
  
  <p>I have another class called <code>Read</code>. In this class I have a loop that needs to read a file, so I want to set the progress with the iterator <code>i</code> from that class. I know that I have to set the minimum and maxium like this:</p>
  
  <pre><code>progressBar.setMinimum(0);
  progressBar.setMaximum(numRows);
  </code></pre>
  
  <p>And for the value:</p>
  
  <pre><code>progressBar.setValue(newValue);
  </code></pre>
  
  <p>How can I set the value for the progressbar so it keeps updating the value of <code>i</code>?</p>