Java Threads — Perpetual Loop in Swing Event Dispatch Thread?

It is not safe to let the Event Dispatch Thread go in a loop.

It is not safe to let the Event Dispatch Thread go in a loop. The event dispatch thread is needed to provide user interaction with the application. If you want an event to go off every few seconds, you should put it, or another copy of it, back on the event queue each time it has completed.

Why wouldn't you just start another thread and let it run/sleep as needed, and have it use SwingUtilities. InvokeLater or whatever to do UI work as necessary? Without any other context it looks like you might be misusing SwingWorker?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions