title: java progressbar on command line [threads]
body: <p>I searched the forum before here and found some implementation examples of a progress bar on command line. Now I have an additional question. I am using the following implementation example:</p>
  
  <pre><code>public void print_progress(int percent){
  
  StringBuilder bar = new StringBuilder(category + ": [");
  
      for(int i = 0; i &lt; 50; i++){
          if( i &lt; (percent/2)){
              bar.append("=");
          }else if( i == (percent/2)){
              bar.append("&gt;");
          }else{
              bar.append(" ");
          }
      }
  
      bar.append("]   " + percent + "%     ");
      System.out.print("\r" + bar.toString());
  }
  </code></pre>
  
  <p>But I want to use it in three threads, running at the same time, want to show the progress for every thread in a bar like that on the command line. Right now whenever a thread calls the print_progress() method it overwrites the one of the thread before.</p>
  
  <p>Can someone tell if that is possible, and if yes, how?</p>
  
  <p>Thanks very much in advance.</p>