Thanks, you show me how to do use ApplicationContext.queueCallback J
It works fine but its a little bit heavy ! Jérôme Serré ____________________________ Manage your cellar <http://www.macave.eu/> http://www.macave.eu De : Jason Dorsey [mailto:[email protected]] Envoyé : lundi 12 décembre 2011 16:25 À : [email protected] Objet : RE: Issue with Threads and Panes Thanks Roger, Had it fixed in less than 5 minutes: public void setStatus(final TestStatus status) { this.status = status; if (label != null) { ApplicationContext.queueCallback(new Runnable() { public void run() { label.setText(status.toString()); setStatusInfo(); } }); } } Jason Dorsey | Engineering Intern 1233 West Loop South Houston, TX 77027 USA <mailto:[email protected]> [email protected] www.attachmate.com | www.netiq.com From: Roger L. Whitcomb [mailto:[email protected]] Sent: Friday, December 09, 2011 5:05 PM To: [email protected] Subject: RE: Issue with Threads and Panes Is the actual update of the UI object done in a separate thread or in the main UI thread? Because all UI changes need to be done in the main application context thread (where the events are being handled) or you will get strange stuff like this happening. You can use ApplicationContext.queueCallback(new Runnable() { }); to get the update happening on the correct thread. If it is happening in the right place, then we potentially have a bug. But, Ive never seen anything like this happening. Roger Whitcomb | Architect, Engineering | [email protected]| Actian Corp. <http://www.actian.com/> | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA <http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C+Sui te+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.677068&ssp n=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr> | +1 650-587-5596 | fax: +1 650-587-5550 From: Jason Dorsey [mailto:[email protected]] Sent: Friday, December 09, 2011 2:56 PM To: [email protected] Subject: Issue with Threads and Panes This is related to the question that I posted earlier that I had to use a workaround for. I have a TablePane with a ScrollPane with yet another TablePane inside it. All of these are in a cardpane. The innermost TablePane contains a list of data pulled from objects that implement Runnable. What is happening is that when the objects status gets updated inside the thread, the proper method is called to update the status field in the UI, but only the color changes. The text does not update until I move the mouse. Example: All objects have an initial status of WAITING. This status is shown in grey. Once it starts RUNNING, it changes to blue. FAIL is red and PASS is green. The colors update properly no matter what, but the text only changes when I move the mouse. Also the color being displayed is a result of a switch case based on the status. Has anyone else noticed delayed changes like this? I cant tell my users to keep the mouse moving. :) Jason Dorsey | Engineering Intern 1233 West Loop South Houston, TX 77027 USA <mailto:[email protected]> [email protected] www.attachmate.com | www.netiq.com
