.......
JTextField jtf = new JTextField();
.......class TM extends Thread{
   long start = System.currentTimeMillis();
   public void run(){
      while(true){
         int time = (System.currentTimeMillis() - start) / 1000;
         jtf.setText(time + "sec");
         try{
            sleep(1000);
         }catch(InturrptedException e){}
      }
   }
}//somewhere to do new TM().start() and don't forget to stop it