Skip to content

Instantly share code, notes, and snippets.

@biwakonbu
Last active December 11, 2015 19:38
Show Gist options
  • Save biwakonbu/4649517 to your computer and use it in GitHub Desktop.
Save biwakonbu/4649517 to your computer and use it in GitHub Desktop.
Java で Window 生成する方法(というかソース) ref: http://qiita.com/items/f37fe7f29d763951e51a
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class HelloWorldSWT {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment