| Change the cursor to an hour glass when necessary
Usage:
EventQueue waitQueue = new WaitCursorEventQueue(500);
Toolkit.getDefaultToolkit().getSystemEventQueue().push(waitQueue);
Part of the trick to this tip is choosing the duration after which the hourglass should appear.
The delay should be long enough that the hourglass will not appear for most events processed
within the UI thread, but it should be short enough so that the user perceives near-immediate
feedback when a more intensive task begins processing. In moderate usability testing,
a delay in the range of about 500 milliseconds appears to work quite well.
Taken from JavaWorld
Race condition fixed by Wenzel Jakob
|