Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Listening to events from a swing element embedded in an SWT composite
Listening to events from a swing element embedded in an SWT composite [message #449499] Tue, 25 January 2005 14:51 Go to next message
Yoav Rubin is currently offline Yoav RubinFriend
Messages: 93
Registered: July 2009
Member
Hi
I am embedding a swing JEditorPane within an SWT Composite, which is nested
in a JFace dialog. I would like to listen to events that occur in the
JEditorPane, and according to them, to either enable/disable the OK button
of the dialog. I tried to access the JFace code from my swing listener, and
got an exception that says that the SWT code is running from the wrong
thread. Does anyone knows if swing opens its own thread, and if so, how can
i still access JFace/SWT elements from swing code.
thanks
Maya and Yoav
Re: Listening to events from a swing element embedded in an SWT composite [message #449521 is a reply to message #449499] Tue, 25 January 2005 16:29 Go to previous message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <ct5mhn$t0k$1@www.eclipse.org>, yoav@il.ibm.com says...
> Hi
> I am embedding a swing JEditorPane within an SWT Composite, which is nested
> in a JFace dialog. I would like to listen to events that occur in the
> JEditorPane, and according to them, to either enable/disable the OK button
> of the dialog. I tried to access the JFace code from my swing listener, and
> got an exception that says that the SWT code is running from the wrong
> thread. Does anyone knows if swing opens its own thread, and if so, how can
> i still access JFace/SWT elements from swing code.
> thanks
> Maya and Yoav


Look at:

Display.getDefault().asyncExec(
new Runnable() {
public void run() {
// SWT UI code here
}
});

Also, the .syncExec() method for in-line execution.

Regards,
Gerald
Previous Topic:How to make SWT application appear in task bar on Windows XP
Next Topic:Crystal reports in eclipse..anyone doing this
Goto Forum:
  


Current Time: Sat Nov 23 02:44:48 GMT 2019

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

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

Back to the top