BorderLayout和成像问题

时间:2015-04-19 13:53:42

标签: gwt gxt

请您查看下面的代码,建议如何纠正它以使其有效?我尝试使用不同的浏览器,但结果是一样的:没有任何反应。只有一个空白屏幕:

public class GXTApp implements EntryPoint {

    public void onModuleLoad() {

        Viewport viewPort = new Viewport();

        final BorderLayout borderLayout = new BorderLayout();
        viewPort.setLayout(borderLayout);

        BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 300);
        westData.setCollapsible(true);
        westData.setSplit(true);

        BorderLayoutData centerData = new BorderLayoutData(Style.LayoutRegion.CENTER);
        centerData.setCollapsible(false);

        ContentPanel navPanel = new ContentPanel();
        ContentPanel mainPanel = new ContentPanel();
        viewPort.add(navPanel, westData);
        viewPort.add(mainPanel, centerData);

        RootPanel.get().add(viewPort);
    }
}

感谢您提供有关如何解决问题的建议

1 个答案:

答案 0 :(得分:0)

这是在GXT 3中

        Viewport viewPort = new Viewport();

        final BorderLayoutContainer borderLayout = new BorderLayoutContainer();
        viewPort.add(borderLayout);

        BorderLayoutData westData = new BorderLayoutData(300);
        westData.setCollapsible(true);
        westData.setSplit(true);

        BorderLayoutData centerData = new BorderLayoutData();
        centerData.setCollapsible(false);

        ContentPanel navPanel = new ContentPanel();
        ContentPanel mainPanel = new ContentPanel();
        borderLayout.setWestWidget(navPanel,westData);
        borderLayout.setCenterWidget(mainPanel);

        RootPanel.get().add(viewPort);