Re: Using SwingWorker with user interaction
- From: "Dan Andrews" <danharrisandrews@xxxxxxxxx>
- Date: 24 Feb 2007 20:50:23 -0800
On Feb 24, 1:50 pm, "Efi Merdler" <foo...@xxxxxxxxx> wrote:
[snip]
In other words, I have a GUI and an engine that runs in the background[snip]
this engine needs to retrieve user interaction with the keyboard and
according to a keyboard click change the graphical interface.
I agree with Knute Johnson, however, you might try a well placed
SwingUtilities.invokeAndWait in your background task.
Alternately and perhaps better, you might consider adding a method to
your SwingWorker's implementation to pass in notification of the key
event (e.g. set/getKeybordEvent which would be synchronized). When
your background task is iterating its work, periodically check the
getKeybordEvent method. Next, as you indicated, publish and update the
GUI in the process method.
Cheers,
Dan Andrews
-----------
http://www.ansir.ca
.
- References:
- Using SwingWorker with user interaction
- From: Efi Merdler
- Using SwingWorker with user interaction
- Prev by Date: Re: Displaying Images
- Next by Date: move four balls in four differnt directions
- Previous by thread: Re: Using SwingWorker with user interaction
- Next by thread: move four balls in four differnt directions
- Index(es):
Relevant Pages
|