ScheduledExecutorService with dating format added to ActionListener
问题 I understand that in Java, it is possible to use a ScheduledExecutorService to perform a specific task after a certain delay. This post shows how to execute the task at a specific date, but not with a SimpleDateFormat . For example, I have a format initialized like below: dateFormatter = new SimpleDateFormat("MM-dd-yyyy hh:mm aa"); Additionally, I want to execute a particular task declared under an else if statement in an ActionListener , such as below: foo.addActionListener(e -> { if