1 30 31 package net.sourceforge.cvsgrab.util; 32 33 34 38 public class MaskingThread extends Thread { 39 private boolean _stop = false; 40 private String _prompt; 41 42 47 public MaskingThread(String prompt) { 48 this._prompt = prompt; 49 } 50 51 54 public void run() { 55 while (!_stop) { 56 try { 57 Thread.sleep(1); 59 } catch (InterruptedException iex) { 60 iex.printStackTrace(); 61 } 62 63 if (!_stop) { 64 System.out.print("\r" + _prompt + " \r" + _prompt); 65 } 66 67 System.out.flush(); 68 } 69 } 70 71 74 public void stopMasking() { 75 this._stop = true; 76 } 77 } 78 | Popular Tags |