Re: SwingWorker.execute() does nothing
- From: Nigel Wade <nmw@xxxxxxxxxxxx>
- Date: Wed, 08 Oct 2008 14:57:18 +0100
Ben Phillips wrote:
Thomas Kellerer wrote:
Ben Phillips, 08.10.2008 08:45:
I've got a strange app hang. A particular button click pops up a modalWhen you call setVisible(true) on a modal dialog, your code will stop
"Please Wait" dialog, then constructs a SwingWorker implementation and
calls execute() on it. The done() method removes the dialog.
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 --
What do you mean, boneheaded? It's what modal Dialogs do.
What /is/ boneheaded is using a component and assuming you know what it does and
how it works. Then, when you find out your assumptions were wrong, blaming the
component for not working how you expected.
and,
moreover, didn't document it anywhere?
It is documented under the setVisible() method of Dialog (from which JDialog
derives) in the API docs, where it says:
Notes for modal dialogs.
* setVisible(true): If the dialog is not already visible, this call will not
return until the dialog is hidden by calling setVisible(false) or dispose.
--
Nigel Wade
.
- Follow-Ups:
- Re: SwingWorker.execute() does nothing
- From: Ben Phillips
- Re: SwingWorker.execute() does nothing
- From: Lew
- 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
- SwingWorker.execute() does nothing
- Prev by Date: Re: Eclipse - "Password Required to connect to sun.java.com"
- Next by Date: Re: Fast-Fourier transform
- Previous by thread: Re: SwingWorker.execute() does nothing
- Next by thread: Re: SwingWorker.execute() does nothing
- Index(es):