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 ***
              

                                                                                                                                      more details                                    

Comments

Popular posts from this blog

How to make Splash Screen in Java using Netbeans with Source Code

Validate Mobile Number in Java Using Netbeans with Source Code