Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Swing/SWT Threading-Problems
Swing/SWT Threading-Problems [message #436827] Tue, 25 May 2004 14:45 Go to next message
Eclipse UserFriend
Originally posted by: mhuenken.cerner.com

Is there a standard way to manipulate SWT components from the AWT_SWT
dispatcher thread when using the Swing/SWT bridge?

I have controls on the Swing part of the UI which are supposed to have an
effect on the SWT part, like changing the layout of a SWT composite by
clicking on a Swing button.

Accessing the SWT composite in such a way is - of course - an invalid
thread access, but I guess (or better: hope) that there is some "proven"
way for inter-thread communication between Swing and SWT.

Since I'm using the integrated Swing components only for a short period of
time I'm looking for a quick & dirty solution (just quick is also ok).

Any help would be greatly appreciated.

Mark
Re: Swing/SWT Threading-Problems [message #436829 is a reply to message #436827] Tue, 25 May 2004 15:16 Go to previous messageGo to next message
Henning Rogge is currently offline Henning RoggeFriend
Messages: 148
Registered: July 2009
Senior Member
markh wrote:
> Is there a standard way to manipulate SWT components from the AWT_SWT
> dispatcher thread when using the Swing/SWT bridge?
>
> I have controls on the Swing part of the UI which are supposed to have an
> effect on the SWT part, like changing the layout of a SWT composite by
> clicking on a Swing button.
>
> Accessing the SWT composite in such a way is - of course - an invalid
> thread access, but I guess (or better: hope) that there is some "proven"
> way for inter-thread communication between Swing and SWT.

Display.asyncExec(...) and Display.syncExec(...) are the two functions
you are looking for I think, they allow you to run a java.lang.Runnable
in the SWT event dispatcher thread.

They are the SWT equivalent of SwingUtilities.invokeLater(...) and
SwingUtilities.invokeAndWait(...).

Henning Rogge
Re: Swing/SWT Threading-Problems [message #437063 is a reply to message #436829] Fri, 28 May 2004 10:57 Go to previous message
Eclipse UserFriend
Originally posted by: mhuenken.cerner.com

Henning Rogge wrote:

> Display.asyncExec(...) and Display.syncExec(...) are the two functions
> you are looking for I think, they allow you to run a java.lang.Runnable
> in the SWT event dispatcher thread.

thanks, that was exactly what I was looking for.

Mark
Previous Topic:Suppress certificate warning dialog
Next Topic:Change constructor options of widget during runtime
Goto Forum:
  


Current Time: Fri Mar 29 05:16:17 GMT 2024

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

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

Back to the top