给定从 Eclipse 视图给我的默认容器,我希望定位 AWT 框架和 SWT 标签。我希望 SWT 标签位于顶部,而 AWT 框架位于其正下方。出于某种原因,我无法让 SWT 标签在框架所在的位置之外绘制。我希望它们是分开的,但 RowLayout 似乎没有将组件放入独立的行中。
SWT 标签不希望地放置在 AWT 框架内:
插件视图中的代码:
public void createPartControl(Composite parent) {
container = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
RowLayout rowLayout = new RowLayout();
//I have tried toggling many of the RowLayout properties but this has no effect on placing the label outside of the AWT Frame.
container.setLayout(rowLayout);
Label topLabel = new Label(container, SWT.NONE);
topLabel.setText("MY NEW LABEL");
frame = org.eclipse.swt.awt.SWT_AWT.new_Frame(container);
frame.setFocusable(true);
frame.setFocusableWindowState(true);