import java.awt.Graphics;
 import java.awt.*;
 import java.util.*;
 import javax.swing.*;
 import java.text.*;
import java.awt.event.*;

class worker3 extends Thread 
{ String name;
  int i;
  public worker3(String s)
  {name=s;i=0;}
 public void run()
 { while(true) 
   {try {Thread.sleep(1000);}
        catch(InterruptedException e)
        {System.err.println(e.toString());}
   i++;}
 }
 public String toString()
 {String s="name : "+name+" i = "+i+"\n";
 return s;
 }
 
}

public class workerP extends JPanel implements Runnable 
{
JTextArea jb;
JPanel inputpanel;
worker3 w1,w2,w3;
Thread runner;
public workerP()
{   inputpanel=new JPanel();
	w1=new worker3("ali");
    w2=new worker3("veli");
    w3=new worker3("zeynep");
    w1.start();
    w2.start();
    w3.start();
    String s=w1.toString()+w2.toString()+w3.toString();
	jb=new JTextArea(s);
	Color c=this.getBackground();
	jb.setBackground(c);
    inputpanel.add(jb);
    add(inputpanel);
    runner=new Thread(this);
    runner.start();
}   
     public void run()
     {
        while(true)
        {
	    String s1=w1.toString()+w2.toString()+w3.toString();
	    jb.setText(s1);
        repaint();
        }
    }
}
