A thread in Java cannot directly access the GUI. With the following snippet the access is possible:
Call from the thread:
@Override
public void run() {
html = "<h1>Huhu</h1>";
dlg.setSomeStuffToGui(html);
}
Method in the GUI:
public void setSomeStuffToGui(final String html) {
Display display = getDisplay();
display.asyncExec(new Runnable() {
public void run() {
//your stuff goes here:
textField.setText(html);
}
});
}