1

我正在使用 Eclipse Neon 4.6。当我打开一个多页向导,并且它的第二页内容是滚动合成时,页面出现空白,根本没有小部件。当我调整大小或最大化编辑器时,会显示内容,我使用的开发环境是 Ubuntu Linux。请帮助解决问题。

请找到下面的代码片段

scrollBar = new ScrolledComposite(容器,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.RESIZE);

scrollBar.setLayout(new FillLayout());
scrollBar.setExpandHorizontal(true);

scrollBar.setExpandVertical(true);
scrollBar.setLayoutData(newGrig);

messageGroup = new Composite(scrollBar, SWT.MULTI | SWT.BORDER);
GridLayout moduleLayout = new GridLayout(1, false);

moduleLayout.verticalSpacing = 0;
messageGroup.setLayout(moduleLayout);

messageGroup.setBackground(container.getBackground());
messageGroup.setLayoutData(newGrig);

scrollBar.setContent(messageGroup);


/**
 * if size exceeds moduleGrid.size, enable scrollbar
 */
scrollBar.addControlListener(new ControlAdapter()
{
    @Override
    public void controlResized(ControlEvent e)
    {
    scrollBar.setMinSize(messageGroup.computeSize(SWT.DEFAULT,
        SWT.DEFAULT));
    }
});
4

0 回答 0