public static void showSashForm(Shell shell)
{
//创建窗框对象,设置样式为水平排列
SashForm form = new SashForm(shell, SWT.HORIZONTAL | SWT.BORDER);
//平滑外观
//SashForm form = new SashForm(shell, SWT.HORIZONTAL | SWT.SMOOTH);
//垂直放置
//SashForm form = new SashForm(shell, SWT.VERTICAL | SWT.BORDER);
form.setLayout(new FillLayout());
//创建窗口1的面板
Composite child1 = new Composite(form, SWT.NONE);
child1.setLayout(new FillLayout());
new Text(child1, SWT.MULTI).setText("窗口 1");
//创建窗口2的面板
Composite child2 = new Composite(form, SWT.NONE);
child2.setLayout(new FillLayout());
new Text(child2, SWT.MULTI).setText("窗口 2");
//设置某一个控件最大化
//form.setMaximizedControl(folder);
//设置还原
//form.setMaximizedControl(null);
//设置初始状态两个面板所占的比例
form.setWeights(new int[]{30, 70});
//设置窗口显示的比例
//form.setWeights(new int[]{30, 30, 40});
}
{
//创建窗框对象,设置样式为水平排列
SashForm form = new SashForm(shell, SWT.HORIZONTAL | SWT.BORDER);
//平滑外观
//SashForm form = new SashForm(shell, SWT.HORIZONTAL | SWT.SMOOTH);
//垂直放置
//SashForm form = new SashForm(shell, SWT.VERTICAL | SWT.BORDER);
form.setLayout(new FillLayout());
//创建窗口1的面板
Composite child1 = new Composite(form, SWT.NONE);
child1.setLayout(new FillLayout());
new Text(child1, SWT.MULTI).setText("窗口 1");
//创建窗口2的面板
Composite child2 = new Composite(form, SWT.NONE);
child2.setLayout(new FillLayout());
new Text(child2, SWT.MULTI).setText("窗口 2");
//设置某一个控件最大化
//form.setMaximizedControl(folder);
//设置还原
//form.setMaximizedControl(null);
//设置初始状态两个面板所占的比例
form.setWeights(new int[]{30, 70});
//设置窗口显示的比例
//form.setWeights(new int[]{30, 30, 40});
}