I need to pass test data to a Swing interval over a period of time. The dataset is long for parsing, so I use SwingWorkerto parse it in the background. When it comes to submitting data to the graphical interface (say, one element per second), I could run Timerout SwingWorker, but that seems redundant. Any reasons not to sleep from the inside out SwingWorker?
SwingWorker
Timer
Greetings
Since it SwingWorkerdoes not work on EDT, sleeping inside is excellent.
SwingWorker , .
-, a Timer a SwingWorker . , , .
SwingWorker, . , .
, , , , , invokeLater, .
invokeLater