?? sashform1.java
字號:
package cn.com.chengang.swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class SashForm1 {
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(327, 253);
// ---------創建窗口中的其他界面組件-------------
SashForm sashForm = new SashForm(shell, SWT.NONE);// 定義一個分割窗容器
// 在SashForm容器中創建三個文本框,默認是按從左到右的順序依次排列
Text text1 = new Text(sashForm, SWT.BORDER);
text1.setText("左");
new Text(sashForm, SWT.BORDER).setText("中");// 簡潔寫法
new Text(sashForm, SWT.BORDER).setText("右");
// 設置分割窗中各欄的寬度比例,左:中:右=3:1:2
sashForm.setWeights(new int[] { 3, 1, 2 });
sashForm.setBounds(10, 10, 206, 168);
// -----------------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 + -