Sleep at SwingWorker?

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?

Greetings

+5
source share
2 answers

Since it SwingWorkerdoes not work on EDT, sleeping inside is excellent.

SwingWorker , .

-, a Timer a SwingWorker . , , .

+4

SwingWorker, . , .

, , , , , invokeLater, .

+3

All Articles