【发布时间】:2018-02-24 00:09:32
【问题描述】:
我在一个 Eclipse 插件上工作,并且在某个时刻显示了一个弹出窗口。在弹出的对话框中,我想创建一个区域,其中左侧有一个标签,右侧有两个按钮。
public void createBottom(Composite parent) {
Composite composite = new Composite(parent, SWT.FILL | SWT.WRAP | SWT.BORDER);
GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
composite.setLayoutData(gridData);
composite.setLayout(new GridLayout(3, false));
addLabel(composite);
addButton1(composite);
addButton2(composite);
}
我怎样才能将左侧的Label 和右侧的两个按钮对齐?
【问题讨论】:
-
什么是
addLabel、addButton1和addButton2? -
@greg-449 他们不是在暗示吗? 3 种方法添加了 3 项。
addLabel添加Test,addButton1添加Ok按钮,addButton2添加Close按钮。 -
“建议”不好。你需要向我们展示一个正确的minimal reproducible example 忽略代码块只会让响应变得更加困难。
-
@greg-449 很抱歉,我会记住的
标签: eclipse eclipse-plugin swt