开发者

The best way to add a grid to a tab panel

开发者 https://www.devze.com 2023-02-01 20:28 出处:网络
What is 开发者_如何学Pythonthe best way to add a grid to a tabpanel for gwt? Thanks!TabPanel has two methods that

What is 开发者_如何学Pythonthe best way to add a grid to a tabpanel for gwt?

Thanks!


TabPanel has two methods that

  • void add(Widget w, String tabText) // Adds a widget to the tab panel.

  • void add(Widget w, String tabText, boolean asHTML) //Adds a widget to the tab panel.

With these methods you can add any widget to the tabpanel. Grid is also widget. So,

    TabPanel tabPanel = new TabPanel();

    Grid grid = new Grid(1, 1);
    tabPanel.add(grid, "firstTab", false);
    grid.setSize("5cm", "3cm");

    RootPanel.get().add(tabPanel);
0

精彩评论

暂无评论...
验证码 换一张
取 消