import java.awt.*;
import java.applet.*;public class ccc extends Applet
{
   TextField f;
   change s;
   public void init()
   {
     f = new TextField();
     add(f);
     s = new change(f);
     s.start();
   }
   
   public void paint(Graphics g)
{
g.drawString("Hello World", 20, 20);
}
}
class change extends Thread
{
  int i = 0;
  TextField tf;
  
  change(TextField  s)
  {
     tf = s;
  }
  
  public void run()
  {
    boolean b;
    b = true;
    while (b)
    {
      if (i>500)
      {
        b = false;
      } 
      i = i+1;
      tf.setText(Integer.toString(i));
      System.out.println(Integer.toString(i));
    }
  }
  }