This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
If you call setVisible(true) on a modal dialog, code subsequent to this instruction will not run until the dialog is disposed and I'm wondering how is this done.
How do you prevent the EDT from proceeding with no other thread to notify it? And if the EDT is blocked, where does event handling for the dialog occur?
I just took a look at the code, and what happens, more or less, is the following:
When you show a modal dialog, it will block the "real" event dispatch thread, but it will start a new thread which deals with the event queue. This new thread will have a filter applied on it, which causes it to block events for the owner of the modal dialog, but deals with other events as it would normally.
When you dismiss the modal dialog, the new thread will stop, and the real event dispatch thread will continue running.
There are no new questions, but there may be new answers.
Joined: Jan 28, 2010
Hi Stephan thanks for your response. I suspected something like this. I'd like to see how this is written but I can't find where in the hierarchy this is implemented. Would you please tell me what method in what class did you look at?