pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pfeffer, Lucien" <lucien.pfef...@kaeser.com>
Subject AW: Problem with repaint of Label
Date Thu, 12 Aug 2010 07:27:05 GMT
The approach in the background tasks example is not applicable for my use case.  


Von: Greg Brown [mailto:gkbrown@mac.com] 
Gesendet: Mittwoch, 11. August 2010 19:41
An: user@pivot.apache.org
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:



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!




Lucien Pfeffer



Von: Greg Brown [mailto:gkbrown@mac.com] 
Gesendet: Mittwoch, 11. August 2010 14:20
An: user@pivot.apache.org
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:



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() {
public void run() {


Here are some old mailing list messages which reference that method.










On 11 August 2010 16:17, Pfeffer, Lucien <lucien.pfeffer@kaeser.com> 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)?




Lucien Pfeffer





View raw message