Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to change background color of 3 text widgets in same time?
How to change background color of 3 text widgets in same time? [message #466405] Tue, 10 January 2006 05:19 Go to next message
Eclipse UserFriend
Originally posted by: smatijasevic.gmail.com

If I try with Thread I get SWTException because I accessing to UI-thread
element from non-UI-thread.
Is there any way to do this?
Re: How to change background color of 3 text widgets in same time? [message #466410 is a reply to message #466405] Tue, 10 January 2006 07:23 Go to previous messageGo to next message
Eclipse UserFriend
You need to package them up into the same Runnable, and use Display.syncExec() or Display.asyncExec() to get it run in the UI thread. (The first will block until it's done; the second will run in the background.)

There's an example of this at http://www-128.ibm.com/developerworks/java/library/os-jface3 /#listing10 in Listing 10. Also, have a look at the SWT information at http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/swt_threading.htm

Alex.
Re: How to change background color of 3 text widgets in same time? [message #466420 is a reply to message #466410] Tue, 10 January 2006 08:56 Go to previous message
Eclipse UserFriend
Originally posted by: smatijasevic.gmail.com

Thank you, it works now :)

"Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
news:14940836.1136895820319.JavaMail.root@cp1.javalobby.org...
> You need to package them up into the same Runnable, and use
> Display.syncExec() or Display.asyncExec() to get it run in the UI thread.
> (The first will block until it's done; the second will run in the
> background.)
>
> There's an example of this at
> http://www-128.ibm.com/developerworks/java/library/os-jface3 /#listing10 in
> Listing 10. Also, have a look at the SWT information at
> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/swt_threading.htm
>
> Alex.
Previous Topic:GridLayout problem
Next Topic:Programmatically scrolling to make a control visible
Goto Forum:
  


Current Time: Sat Jul 05 03:31:28 EDT 2025

Powered by FUDForum. Page generated in 0.03491 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top