1

Topic: Java swing Timer

In application Java Swing it is necessary to fulfill throughout all operating time of the program in  a mode short operation with periodicity in 1 second. Whether normally for these purposes to use the timer (javax.swing. Timer) or it is better to get a separate flow?

2

Re: Java swing Timer

Hello, dmitritch, you wrote: D> In application Java Swing it is necessary to fulfill throughout all operating time of the program in  a mode short operation with periodicity in 1 second. Whether normally for these purposes to use the timer (javax.swing. Timer) or it is better to get a separate flow? If your operation is somehow connected with Swing GUI then javax.swing. Timer that that is necessary, if is not present then better java.util.concurrent.ScheduledExecutorService or in a case if in the project is  that @Scheduled (fixedRate=1000)

3

Re: Java swing Timer

Hello, dmitritch, you wrote: D> In application Java Swing it is necessary to fulfill throughout all operating time of the program in  a mode short operation with periodicity in 1 second. Whether normally for these purposes to use the timer (javax.swing. Timer) or it is better to get a separate flow? - As operation short the user, most likely does not note. Accordingly javax.swing. Timer th it is possible to manage.  after all it is somehow connected with GUI? - If operation noticeably influences sensations of the user from UI (once a second, it  is frequent enough) it is better through ScheduledExecutorService. And updates UI to launch through SwingUtilities.invokeLater () - it is important to understand that decisions enumerated above are not synchronized with current time. If calendar accuracy it is necessary or most to fence a bicycle is necessary, or to take Quartz.