/**
* Title:Simple process minitor
* Create Date:2006-12-16
* Author:Marco Hu
*/
import java.io.IOException;
public class SimpleProcess extends Thread
{
boolean stop=false;
int per=0;
public static void main(String[] args) throws Exception
{
SimpleProcess t=new SimpleProcess();
t.start();
}
public void run()
{
System.out.println ("Runing:");
while(!stop)
{
try
{
for(int i=1;i<=100;i++)
{
SimpleProcess.this.print();
Thread.sleep(100);
if(i==100)
stop=true;
}
System.out.println
("\nCompleted!!");
}
catch (Exception e)
{
}
}
}
public void print()
{
per++;
for(int len=1;len<=100;len++)
{
System.out.write(8);
System.out.flush();
}
System.out.print (per+"%");
}
}