Ok. You have AWT embeded into SWT right? So you have got two different
threads running (one for AWT and one from SWT) if you want to to do
something from the AWT-Thread in SWT you need to use asyncExec/syncExec
calls.
Display.getCurrent().syncExec( new Runnable() {
public void run() {
Display.getCurrent().addFilter(....);
}
});
Tom
Mirco Dunker schrieb:
Hi,
it was my fault getDefault() returns not null. Now I got an "Exception
in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid
thread access" when I try to add an filter to the Display.
Regards,
Mirco
Mirco Dunker schrieb:
Hi,
Calling getDisplay() or getCurrent() always returns null.
For example I want to get the events from eclipse. How can I get the
Display which belongs to eclipse?
Regards,
Mirco
Tom Schindl schrieb:
Hi,
you can get it from any widget by calling getDisplay() or by calling
Display#getCurrent() which is a static method.
Tom
Mirco Dunker schrieb:
Hi,
I don't have much experience in swt, how can i get the current Display?
The running Display wasn't created by myself.
Regards,
Mirco
Tom Schindl schrieb:
Hi,
In SWT you use: Display#addFilter()
Tom
Mirco Dunker schrieb:
Hi,
i want to trace some SWT Events. With AWT its really easy to do this:
Toolkit.getDefaultToolkit().getSystemEventQueue().push(
new EventQueue() {
protected void dispatchEvent(AWTEvent event) {
//do something
super.dispatchEvent(event);
}
});
How can i do this for SWT?
Regards,
Mirco