Org.eclipse.swt.widgets.Display
lastmod 2026-11-10created 2014-05-262 edits
org.eclipse.swt.widgets.Display is the class that connects an SWT application to the operating system's window system, and it is responsible for the event loop and the UI thread. Usually only one is created per program; events are processed with readAndDispatch and sleep, and work is handed from other threads to the UI thread with asyncExec and syncExec. With timerExec, delayed execution or repeating timers can be implemented without a separate thread.
Create SWT Timer
Display.getDefault().timerExec(2000, new Runnable() {
@Override
public void run() {
// TODO...
}
});