Re: Example code from SwingWorker documentation could have race condition?



On Jan 31, 12:07 am, lion...@xxxxxxxxx wrote:
On Jan 31, 4:34 pm, lion...@xxxxxxxxx wrote:
[snip]

I suspect I may have figured it out. Because swingWorker.execute() is
called from the EDT this thread is already executing, so any other
actions that are requested to execute must do so after this has
finished, thus dialog.setVisible(true) will always occur first.

Cany anyone confirm that? I figured it out after sticking in some
sleep times in there.

Lionel.


I would guess you are right.
The creation of the JDialog box, and the following setVisible(true)
will all be executed in the EDT. "uninterrupted" by other EDT tasks.

.



Relevant Pages