title: How to change the default Java Icon in JProgressBar?
body: <p>I searched all the way but unable to find the solution.
   I want to change the default java icon in the progress bar,
  as I used <code>JProgressBar</code>.</p>
  
  <p>Here is my small snippet</p>
  
  <pre><code>public class SwingWorkerProgressMonitor implements PropertyChangeListener {
  
  private static final int PROGRESS_BAR_WIDTH = 200;
  private ProgressMonitor progressMonitor;
  private final SwingWorker&lt;?, ?&gt; task;
  private SwingWorker&lt;Void, Void&gt; backingTask;
  private String message;
  private final JProgressBar progressBar = new JProgressBar();
  int progress = 0;
  private final String title;
  
  /*
   * Progress monitor that takes a swing worker and shows its progress
   */
  public SwingWorkerProgressMonitor(SwingWorker&lt;?, ?&gt; sw, String title) {
  
  this.task = sw;
  this.title = title;
  
  }
  
  /**
   * This Fu2nction Invoked when task's progress property changes.
   */
  @Override
  public void propertyChange(PropertyChangeEvent evt) {
  if (evt.getPropertyName().equals("progress")) {
      int progress = (Integer) evt.getNewValue();
      updateProgress(progress);
  }
  
  }
  
  private void updateProgress(int progress) {
  progressMonitor.setProgress(progress);
  message = String.format(PlasaApplication.getTranslator().getString(PlasaLanguageKey.PROGRESS_LODING_DATA)
      + "(%d%%)", progress);
  progressMonitor.setNote(message);
  if (progressMonitor.isCanceled() || task.isDone()) {
      Toolkit.getDefaultToolkit().beep();
      if (progressMonitor.isCanceled()) {
      task.cancel(true);
      }
  }
  }
  
  /**
   * This function start the progress When click the save button on
   * 
   * 
   * @param component
   */
  public void start(Component component) {
  // creates progress bar
  Dimension preferredSize = progressBar.getPreferredSize();
  preferredSize.width = PROGRESS_BAR_WIDTH;
  progressBar.setPreferredSize(preferredSize);
  UIManager.put("ProgressMonitor.progressText", title);
  UIManager.put("OptionPane.cancelButtonText",
      PlasaApplication.getTranslator().getString(PlasaLanguageKey.GLOBAL_CANCEL));
  progressMonitor = new ProgressMonitor(progressBar, "", "", 0, 100);
  progressMonitor.setProgress(0);
  
  if (task == null) {
      throw new IllegalArgumentException("swing worker is not set");
  }
  
  backingTask = new BackingTask(task);
  task.addPropertyChangeListener(this);
  backingTask.execute();
  }
  
  /**
   * Inner class Here begin the progress status
   * 
   */
  private class BackingTask extends SwingWorker&lt;Void, Void&gt; {
  
  SwingWorker&lt;?, ?&gt; worker; // backing worker
  
  public BackingTask(SwingWorker&lt;?, ?&gt; worker) {
  
      this.worker = worker;
  
  }
  
  // run the task on background
  @Override
  protected Void doInBackground() throws Exception {
  
      worker.execute();
      return null;
  };
  
  /**
   * This function close the progress monitor when task is done or cancel
   */
  @Override
  public void done() {
      Toolkit.getDefaultToolkit().beep();
      progressMonitor.close();
  }
  
  }
  </code></pre>
  
  <p>}</p>