how timer class and display to jtextfield w3schools in java

Java
import java.time.LocalTime;  // import the LocalTime class

public class MyClass {  
  public static void main(String[] args) {  
    LocalTime myObj = LocalTime.now();
    System.out.println(myObj);
  }  
}  

Source

Also in Java: