Re: Using SwingWorker with user interaction



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
this engine needs to retrieve user interaction with the keyboard and
according to a keyboard click change the graphical interface.
[snip]

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



.



Relevant Pages

  • Re: the new interface
    ... If your user can't use a single button apple mouse to effeciently and ... The entire point of a graphical interface is to accomplish ... defer to the keyboard (multiple task scripts aside) you loose time. ...
    (comp.lang.basic.realbasic)
  • Re: Linux/X-Windows unable to set focus on a modal form (Consulting $ anyone)
    ... focus is stolen from the window and you CANNOT use the keyboard or any ... Knute Johnson ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.gui)
  • Re: How to enter characters beyond keyboard into JTextField?
    ... Knute Johnson wrote: ... For example if I want to enter the 1/2 character \u00bd. ... I thought on a Winblows machine that you could do that by holding down the ALT key and then typing a sequence of numbers. ...
    (comp.lang.java.gui)
  • How to enter characters beyond keyboard into JTextField?
    ... How do I enter characters from the keyboard that aren't on the keyboard? ... I thought on a Winblows machine that you could do that by holding down the ALT key and then typing a sequence of numbers. ... Knute Johnson ...
    (comp.lang.java.gui)