import java.util.*;
import java.awt.*;
import javax.swing.*;

public class Reloj extends Thread{
    JTextField t;
    
    Reloj(JTextField tt){
        t=tt;
    }
    
    public void run(){
        while(true){
            Date d=new Date();
            int hh=d.getHours();
            int mm=d.getMinutes();
            int ss=d.getSeconds();
            t.setText(hh+":"+mm+":"+ss);
            try{
                Thread.sleep(500);
            }catch(Exception e){
            }
        }
    }

}
