gpt4 book ai didi

java - 将 TabLayoutPanel 放入 SplitLayoutPanel 时出现空白页面

转载 作者:行者123 更新时间:2023-12-02 08:11:59 27 4
gpt4 key购买 nike

我有一个 GWT 代码,但结果是空页。为什么?

public void onModuleLoad() {
leftPanelSetup();

rightPanelSetup();

splitPanelSetup();
}



private void splitPanelSetup() {
SplitLayoutPanel layoutPanel = new SplitLayoutPanel();
layoutPanel.addWest(leftTabLayoutPanel, 300);
layoutPanel.addEast(rightTabLayoutPanel, 400);

RootPanel.get("content").add(layoutPanel);
}

private void leftPanelSetup() {
// Create a tab panel
leftTabLayoutPanel = new TabLayoutPanel(1.5, Style.Unit.EM);

//leftTabPanel.setWidth("300px");

// 1
VerticalPanel vPanel1 = new VerticalPanel();
leftTabLayoutPanel.add(vPanel1, "Russian");

// 2
VerticalPanel vPanel2 = new VerticalPanel();
leftTabLayoutPanel.add(vPanel2, "English");

// 3
VerticalPanel vPanel3 = new VerticalPanel();
leftTabLayoutPanel.add(vPanel3, "French");

// Make the first tab selected and the tab's content visible
leftTabLayoutPanel.selectTab(0);

//RootPanel.get("content").add(tabPanel);
}

private void rightPanelSetup() {
// Create a tab panel
rightTabLayoutPanel = new TabLayoutPanel(1.5, Style.Unit.EM);

//rightTabPanel.setWidth("400px");

// 1
VerticalPanel vPanel1 = new VerticalPanel();
rightTabLayoutPanel.add(vPanel1, "Russian");

// 2
VerticalPanel vPanel2 = new VerticalPanel();
rightTabLayoutPanel.add(vPanel2, "English");

// 3
VerticalPanel vPanel3 = new VerticalPanel();
rightTabLayoutPanel.add(vPanel3, "French");

// Make the first tab selected and the tab's content visible
rightTabLayoutPanel.selectTab(0);

//RootPanel.get("content").add(tabPanel);
}

最佳答案

SplitLayoutpanel 添加到 RootLayoutPanel,而不是 RootPanel

关于java - 将 TabLayoutPanel 放入 SplitLayoutPanel 时出现空白页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7230766/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com