public class HelloWorldSWT {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello world!");
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
出力:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Display cannot be resolved to a type
Display cannot be resolved to a type
Shell cannot be resolved to a type
Shell cannot be resolved to a type
at HelloWorldSWT.main(HelloWorldSWT.java:10)
私はJavaが初めてで、これらを試しましたが、まだ機能していません:
命令は私に言った:コンパイルエラーが発生します。Java エディターで右クリックし、[ソース] > [インポートの整理] を選択して、変更を保存します。