?? sashform2.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 SashForm2 {
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);
new Text(sashForm, SWT.BORDER).setText("左");
SashForm rightSashForm = new SashForm(sashForm, SWT.VERTICAL);// 內嵌一個分割窗容器
new Text(rightSashForm, SWT.BORDER).setText("右上");
new Text(rightSashForm, SWT.BORDER).setText("右下");
sashForm.setWeights(new int[] { 1, 3 });
rightSashForm.setWeights(new int[] { 5, 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 + -