org.eclipse.swt.SWTException: Invalid thread access
Bonjour
Je viens de reinstaller Eclipse Galileo et SWT
J'ai créé une simple application de test.
J'ai importé SWT comme d'habitude
et je me fais jeter par l'injure :
org.eclipse.swt.SWTException: Invalid thread access
Mon code est :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
public class Test {
public static Display display = new Display();
public Test(){
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("test");
shell.setSize(400, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
public static void main(String[] args) {
new Test();
}
} |
Une idée ?
merci