swt - 我应该如何在 SWT 中显示 Pagebook 控件?
问题描述
我目前正在创建一个如下所示的wizardPage。 图中用pagebook控件来表示评论,写了如下代码。但是,它不能在 Pagebok 中表示。我应该如何解决它?
//更新 PageBook
protected void updatePageBook(final Composite parent) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
pageBook = new PageBook(parent, SWT.BORDER);
pageBook.setLayoutData(createSubPane(getShell(), 2));
availableSheetLabel = new Label(pageBook, SWT.BORDER);
availableSheetLabel.setText(Messages.ChooseDomainFileWizardPage_12);
pageBook.showPage(availableSheetLabel);
}
});
}
private Composite createSubPane(Composite parent, int numControl) {
Composite result = new Composite(parent, SWT.NORMAL);
GridLayout layout = new GridLayout(numControl, false);
layout.marginWidth = layout.marginHeight = 0;
result.setLayout(layout);
result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
return result;
}
解决方案
推荐阅读
- docker - Docker - 错误:adduser:UID 0 已在使用中
- java - LogstashJsonEventLayoutV1.json - 带有 JSON 值的“消息”元素
- lua - 在lua中获取表
- java - 如何为多个 jar 文件设置类路径?
- ios - 如何在 Firebase Analytics 中发送事件中的项目列表 - iOS
- sql - ON CONFLICT ... DO UPDATE SET 因重复行而失败
- typescript - 构造部分对象并正确推断类型
- python - 为什么 numpy RandomState 会给出不同的结果?
- firebase - 在 Tapkey 上处理过期 Firebase 令牌的最佳方法
- typescript - 找不到模块“rxjs”的声明文件。隐含地具有“任何”类型。尝试 `npm i --save-dev @types/rxjs 或添加新声明