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);
精彩评论