How to set Date & Time in Java Jframe Using Netbeans with Source Code
How to set Date & Time in Java Jframe Using Netbeans with Source Code
***Source Code***
public void time()
{
DateTimeFormatter times =DateTimeFormatter .ofPattern("hh : mm a");
LocalDateTime now =LocalDateTime.now();
time.setText(times.format(now));
}
public void date()
{
DateTimeFormatter dates =DateTimeFormatter .ofPattern("yyyy/MM/dd");
LocalDateTime now =LocalDateTime.now();
date.setText(dates.format(now));
}
*** Now call a method ***
Comments
Post a Comment