code: private void removeProgressBar(Progress prog, JProgressBar pbar) {
      synchronized(pbarmap) {
        pbarmap.remove(prog);
        SwingUtilities.invokeLater(() -> removeProgressBar(pbar));
      }
    }
docs: Remove a progress bar
  
  @param prog Progress
  @param pbar Associated progress bar