开发者

The best way to add a grid to a tab panel

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜