Re: SwingWorker.execute() does nothing
- From: Ben Phillips <b.phillips@xxxxxxxxxxxxxxxxx>
- Date: Wed, 08 Oct 2008 20:47:25 -0400
Nigel Wade wrote:
Ben Phillips wrote:
Thomas Kellerer wrote:Ben Phillips, 08.10.2008 08:45:Really? What idiot made that boneheaded design decision --I've got a strange app hang. A particular button click pops up a modal "Please Wait" dialog, then constructs a SwingWorker implementation and calls execute() on it. The done() method removes the dialog.When you call setVisible(true) on a modal dialog, your code will stop until the dialog is closed. So if you call SwingWorker.execute() after setVisible(true) the execute() will not be called until the dialog is closed.
What do you mean, boneheaded? It's what modal Dialogs do.
It's not the behavior implied by the Swing tutorial, which says that there is exactly one event dispatch thread.
What /is/ boneheaded is [personal attacks that are not relevant here]
Please do not post unconstructive material, particularly personal attacks.
It is documented under the setVisible() method of Dialog (from which JDialog
derives) in the API docs
But that was not where I was looking. Since the problem appeared to be with SwingWorker.execute(), *that* was where I was looking. Obviously, documentation of a "gotcha" is not very useful if it is not located where the user is most likely to look for it.
Perhaps a note to this effect should be in *both* places, given the likelihood that someone will be showing a modal progress dialog or other such thing during a long-running operation, and given the natural tendency to want to pop up the dialog *first* and *then* start the operation.
.
- Follow-Ups:
- Re: SwingWorker.execute() does nothing
- From: Peter Duniho
- Re: SwingWorker.execute() does nothing
- From: John W Kennedy
- Re: SwingWorker.execute() does nothing
- References:
- SwingWorker.execute() does nothing
- From: Ben Phillips
- Re: SwingWorker.execute() does nothing
- From: Thomas Kellerer
- Re: SwingWorker.execute() does nothing
- From: Ben Phillips
- Re: SwingWorker.execute() does nothing
- From: Nigel Wade
- SwingWorker.execute() does nothing
- Prev by Date: Re: JComboBox: setting the editable text
- Next by Date: Re: SwingWorker.execute() silently fails?
- Previous by thread: Re: SwingWorker.execute() does nothing
- Next by thread: Re: SwingWorker.execute() does nothing
- Index(es):