title: Update JProgresBar located inside EventQueue.InvokeLater
body: <p>I have a problem with updating JProgressBar:</p>
  
  <pre><code>//Start to search for files on drives
  private void searchForDICOMFIles2(ArrayList&lt;String&gt; foundDriveLetters)
  {
  
      //Thread 1 - search for DICOM files and add them to array
      EventQueue.invokeLater(new Runnable() {
          public void run() {
              try {
  
                  ////here is the problem
                  for (String currentDriveLetter_2:foundDriveLetters)
                  {
                      File currentDrive_2 = new File(currentDriveLetter_2);
                      checkFilesAndFoldersForDICOMFiles(currentDrive_2);
  
                  }
  
                  //updating here will work
                  Screen_ImportingFiles.setCheckMarkForTaskLabel(1);
                  Screen_ImportingFiles.updateProgressBar(25, 1, true);
  
              } catch (Exception e) {
                  e.printStackTrace();
  </code></pre>
  
  <p>Method checkFilesAndFoldersForDICOMFiles is a huge FOR loop which iterates through files on drive and searches for DICOM files based on extension and if there is no extension, it tries to read the file to determine if it is DICOM or not. Based on the number of files, it also wants to display progression of file checking (i.e. 50% would mean it checked 150 file out of 300). When I want to update progress bar from this method it is not updating progression Bar on JFrame.</p>
  
  <p>Is there a way how to update progress bar like this?</p>