Re: SwingWorker.execute() does nothing
- From: Ben Phillips <b.phillips@xxxxxxxxxxxxxxxxx>
- Date: Wed, 08 Oct 2008 04:48:34 -0400
Thomas Kellerer wrote:
Ben Phillips, 08.10.2008 08:45: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.
Really? What idiot made that boneheaded design decision -- and, moreover, didn't document it anywhere?
I'll see if simply swapping the setVisible(true) to after the execute() fixes things. I definitely don't want the UI to receive input events while this work is going on, but I don't want it to hang (not paint properly) either, and eventually I might want to put a working Cancel button on the "Please Wait" dialog too. (Were it not for those considerations, I'd just have the work done on the EDT and the heck with it!)
.
- Follow-Ups:
- Re: SwingWorker.execute() does nothing
- From: Nigel Wade
- Re: SwingWorker.execute() does nothing
- From: Thomas Kellerer
- Re: SwingWorker.execute() does nothing
- References:
- SwingWorker.execute() does nothing
- From: Ben Phillips
- Re: SwingWorker.execute() does nothing
- From: Thomas Kellerer
- SwingWorker.execute() does nothing
- Prev by Date: Re: SwingWorker.execute() does nothing
- Next by Date: Re: SwingWorker.execute() does nothing
- Previous by thread: Re: SwingWorker.execute() does nothing
- Next by thread: Re: SwingWorker.execute() does nothing
- Index(es):