I have been working on a cafe management system which has a GUI. I'd like to add a dynamic date to one of my textfiled. I found something like this;
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("HH:mm:ss MM/dd/yyyy ");
while(true){
LocalDateTime now = LocalDateTime.now();
jTextArea6.setText(dtf.format(now));
}
When I try to add that code to my program it doesn't work. It probably happens because of while loop. What do you recommend? I saw some kinda thread issues but many of those posts shared 8-9 years ago.