Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10: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 12:23 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
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 13: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: Thu Jul 18 16:03:44 GMT 2019

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

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

Back to the top