title: JProgressBar wont update
body: <p>I'm trying to add a JProgressBar to my program, but it wont update! The value only changes once it reasons 100%. Here's my method.</p>
  
  <pre><code>public void downloadImages(List&lt;String&gt; images) {
      if (errorCode == 0) {
          for (int i = 0; i &lt; images.size(); i++) {
              if (errorCode == 0) {
                  main.progressLabel.setText("Downloading image " + Integer.toString(i + 1) + " of " + Integer.toString(images.size()));
                  String imageStr = images.get(i);
                  String imageName = imageStr.substring(imageStr.lastIndexOf("/") + 1);
                  try {
                      URL url = new URL(imageStr);
                      InputStream in = url.openStream();
                      OutputStream out = new FileOutputStream(saveDirectory + imageName);
  
                      byte[] b = new byte[2048];
                      int length;
                      while ((length = in.read(b)) != -1) {
                          out.write(b, 0, length);
                      }
  
                      in.close();
                      out.close();
                  } catch (MalformedURLException e) {
                      errorCode = BAD_URL;
                  } catch (IOException e) {
                      errorCode = INVALID_PATH;
                  }
                  main.progressBar.setValue(((i+1)/images.size())*100);
              }
  
          }
      }
  }
  </code></pre>
  
  <p>Changing the progress bar value is at the bottom of the method above.</p>
  
  <p>And here is how I call that method.</p>
  
  <pre><code>public void download() {
      final Downloader downloader = new Downloader(this, albumUrl.getText(), downloadPath.getText());
      progressBar.setValue(0);
      downloadButton.setEnabled(false);
  
      new Thread(new Runnable() {
          public void run() {
              List&lt;String&gt; images = downloader.getImages(downloader.getPageSource());
              downloader.downloadImages(images);
              if (downloader.getErrorCode() == 0) {
                  progressLabel.setText("All images have been downloaded!");
              } else {
                  String error = "";
                  switch (downloader.getErrorCode()) {
                  case Downloader.BAD_URL:
                  case Downloader.NOT_IMGUR_ALBUM:
                      error = "The URL entered is either invalid or does not link to an Imgur album.";
                      break;
                  case Downloader.BLANK_URL:
                      error = "The album URL field cannot be blank.";
                      break;
                  case Downloader.INVALID_PATH:
                      error = "The system cannot find the download directory path specified.";
                      break;
                  case Downloader.BLANK_PATH:
                      error = "The download directory cannot be blank.";
                      break;
                  case Downloader.CANNOT_READ_URL:
                      error = "An error occoured while reading the URL.";
                      break;
                  case Downloader.PARSING_ERROR:
                      error = "An error occoured while parsing the URL.";
                      break;
                  }
                  JOptionPane.showMessageDialog(Main.this, error, "Error", 0);
              }
              downloadButton.setEnabled(true);
          }
      }).start();
  }
  </code></pre>
  
  <p>EDIT: The above was not the problem at all, the problem one the program was using Integer Division and not decimal.</p>