import java.awt.*;
import java.awt.event.*;
class  Thread1 extends Frame implements Runnable
{
	int Delay,i,j,t;
    String s;
	TextField tf1,tf2;
	public Thread1(String b, int delay,int k)
	{
		setTitle("hello");
		setSize(400,200);
		setLayout(new GridLayout (2,1));
		setVisible(true);
		tf1=new TextField();
		tf2=new TextField();
		add(tf1);
		add(tf2);
		Delay=delay;
		s=b;
		j=k;
	}
   public void run()
   {t=0;
        for(int i=1;i<=10;i++)
        try
       {
        Thread.sleep(Delay);
		tf1.setText(""+s+""+t);
		tf2.setText(""+s+""+t);
		t+=j;
       }
       catch(InterruptedException e){}
   }

   public static void main(String[] args)
   {
		Thread1 td=new Thread1("t1=",1000,1);
		Thread1 tf=new Thread1("t2=",2000,2);
			Thread tl1=new Thread(td);
			Thread tl2=new Thread(tf);
			tl1.start();
			tl2.start();
     
   }
}

