Personal tools
You are here: Home SwingとSWT チュートリアル 入門編 - JFrame と Shell - SampleShell.java
Document Actions

SampleShell.java

by fujisaki last modified 2008-11-23 22:00

Click here to get the file

Size 1 kB - File type text/x-java

File contents

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SampleShell {
    public static void main(String[] args) {
	// ディスプレイ生成
	Display display = new Display();

	// フレーム生成
	Shell shell = new Shell(display);


	// フレームのサイズ
	shell.setSize(200, 150);

	// フレームのタイトル
	shell.setText("フレーム");
	

	// フレームを表示
	shell.open();

	// フレームを閉じるまでディスプレイを終了しない.
	while (!shell.isDisposed()) {
	    if (!display.readAndDispatch()) {
		display.sleep();
	    }
	}
	display.dispose();
    }
}