The approach in the background tasks example is not applicable for my use case.
Von: Greg Brown [mailto:[email protected]] Gesendet: Mittwoch, 11. August 2010 19:41 An: [email protected] Betreff: Re: Problem with repaint of Label Are you saying that the background tasks example doesn't work, or that the approach used in that example does not work for your use case? On Aug 11, 2010, at 9:05 AM, Pfeffer, Lucien wrote: Hello, The solution of Chris is working. I tried both, using Task and Thread-based class. Now I´m using a Thread which calls the queueCallback and it works quite well. The version using TaskAdapter like in the example "Background Tasks" in the tutorial didn`t work anyhow. Lots of thanks for helping! Regards Lucien Pfeffer Von: Greg Brown [mailto:[email protected]] Gesendet: Mittwoch, 11. August 2010 14:20 An: [email protected] Betreff: Re: Problem with repaint of Label Are you actually using a Task or are you using your own Thread-based class? If you are using Task, TaskAdapter should do it. Otherwise, you can use queueCallback() as Chris describes below. It is similar to SwingUtilities.invokeLater(), if you are familiar with that. On Aug 11, 2010, at 6:09 AM, Chris Bartlett wrote: Lucien, I'm not sure if the databinding aspect changes things, but I think this is what ApplicationContext.queueCallback(Runnable) is for. ApplicationContext.queueCallback(new Runnable() { @Override public void run() { statusLabel.setText(status); } }); Here are some old mailing list messages which reference that method. http://mail-archives.apache.org/mod_mbox/pivot-user/201002.mbox/%[email protected]%3e http://www.google.com/search?hl=en&client=opera&rls=en&q=queueCallback+site%3Ahttp%3A%2F%2Fmail-archives.apache.org%2Fmod_mbox%2Fpivot+-%22svn+commit%22&aq=f&oq=&aqi= Regards, Chris On 11 August 2010 16:17, Pfeffer, Lucien <[email protected]> wrote: I have a thread with an endless loop collecting data from ethernet and set it into "Text" property of Labels on a Frame using Databinding. The Problem is that the text (Label) is only repainted if the mouse is moved over the window. I tried using the repaint method with no success. I also tried using a Task with an TaskListener wrapped in a TaskAdapter. But this also didn`t work, it is furthermore only repainted on mouse movement. Is there any possibility to force the repaint of the Label(s)? Regards Lucien Pfeffer
