Foxtrot

SourceForge.net Logo Java.net Logo

Overview

The Problem

Asynchronous Solution

Synchronous Solutions

Foxtrot

Foxtrot & Swing

Known Foxtrot Limitations

The mechanism used by Worker and ConcurrentWorker to block and re-route the Event Dispatch Thread is very similar to the mechanism used by JDialog, but not exactly the same because the API is private to package java.awt.

With JDK 1.4.x, 5.0.x and 6.0.x, it is possible that in some case (more specifically in some case that involves focus events or window focus events), Foxtrot is not able to start the event pumping mechanism that ensures that the user interface does not "freeze".
In these cases, Foxtrot will execute the task in the worker thread, while AWT events will add up in the event queue. When the task completes and the listener returns, the events will be dequeued normally by the Event Dispatch Thread.
The result is that the user interface will appear to be "frozen", exactly as if the time-consuming task is executed in the Event Dispatch Thread.

For maximum user interface responsiveness, it is better to use AsyncWorker in the implementation of methods of java.awt.event.FocusListener and java.awt.event.WindowFocusListener.