import javax.swing.*;
import java.awt.Graphics;
class worker3 extends Thread 
{public String name; 
 public int i;
 public worker3(String namei)
 {name=namei;i=0;}
 
 public String toString()
 {return name+"--->"+i+"\n";}
 
 public void run()
 { while(true) 
   {   try{
	   if(name.equals("ali")) Thread.sleep(1000);
	   else if(name.equals("veli")) Thread.sleep(2000);
	   else Thread.sleep(3000);
       i++;
      }catch(InterruptedException ex) {System.out.println("error");}
   }
 }
}

public class H9Ex3 extends JPanel
{
	JLabel jb;
	worker3 i1,i2,i3;
	
	public H9Ex3()
	{
	i1=new worker3("ali");
    i2=new worker3("veli");
    i3=new worker3("zeynep");
    jb=new JLabel("");
	add(jb);
	i1.start();
	i2.start();
	i3.start();
	}
 public void paint(Graphics g)
 {
     String s=i1.toString()+i2.toString()+i3.toString();
     jb.setText(s);
     repaint();
 }
}
