?? filllayout3.java
字號:
package cn.com.chengang.swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class FillLayout3 {
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(327, 253);
// ---------創建窗口中的其他界面組件-------------
FillLayout layout = new FillLayout();// new FillLayout(SWT.VERTICAL)和layout.type等效
layout.marginWidth = 20;// 左右邊界寬度
layout.marginHeight = 10;// 上下邊界高度
layout.spacing = 15;// 組件間隔寬度
layout.type = SWT.VERTICAL;// 豎著排列
shell.setLayout(layout);
new Button(shell, SWT.NONE).setText("確定");
new Button(shell, SWT.NONE).setText("取消");
new Button(shell, SWT.NONE).setText("幫助");
// -----------------END------------------------
shell.layout();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -