Content deleted Content added
MOS:HEAD |
m HTTP to HTTPS for SourceForge |
||
Line 94:
Often, your EDT handles a GUI component action, which demands the user to make a choice by means of another dialog, like JFileChooser, which pops up, stays responsive while user picks its option and action proceeds with selected file only after "OK" button is pressed. You see, this takes time (user responds in matter of seconds) and you need a responsive GUI (the messages are still pumped in EDT) during all this time while EDT is blocking (it does not handle newer, e.g. JFileChooser, messages in the queue before the dialog is closed and current component action is finished). The vicious cycle is broken through EDT entering a new message loop, which dispatches the messages as per normal until "modal dialog is over" arrives and normal message processing resumes from the blocked position in the component action.
The open source '''[
<syntaxhighlight lang="java">
Line 135:
* [http://download.oracle.com/javase/tutorial/uiswing/concurrency/worker.html SwingWorker] description from the Swing tutorial
* [http://tech.stolsvik.com/2009/03/awt-swing-event-pumping-and-targeting.html AWT/Swing event handling] article about event pumping, dispatch and processing, and the EDT
* [
{{DEFAULTSORT:Event Dispatching Thread}}
|