トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

Composite

Compositeは各種ウィジェットのスーパークラスであり、 SwingのJPanelのように、他のウィジェットのコンテナとして使用することができます。レイアウトを組み合わせて複雑な配置をしたいときに有効です。

shell.setLayout(new FillLayout(SWT.HORIZONTAL));

Composite composite1 = new Composite(shell,SWT.NULL);
composite1.setLayout(new FillLayout(SWT.VERTICAL));

Composite composite2 = new Composite(shell,SWT.NULL);
composite2.setLayout(new FillLayout(SWT.VERTICAL));

// canvas1にLabelを2つ追加
new Label(composite1,SWT.BORDER).setText("Label1");
new Label(composite1,SWT.BORDER).setText("Label2");

// canvas2にLabelを2つ追加
new Label(composite2,SWT.BORDER).setText("Label3");
new Label(composite2,SWT.BORDER).setText("Label4");

最終更新時間:2004年03月09日 03時52分42秒