通过这些行,我只为选项卡面板添加了一个小部件:
DialogBox popupProperties = new DialogBox();
TabPanel tabPanel = new TabPanel();
HTML label1 = new HTML("<ul><li><b>This is contents of TAB1</b></li</ul>");
label1.setHeight("200");
Label label2 = new Label("This is contents of TAB 2");
label2.setHeight("200");
Label label3 = new Label("This is contents of TAB 3");
label3.setHeight("200");
String tab1Title = "One";
String tab2Title = "Two";
String tab3Title = "Three";
tabPanel.add(label1,tab1Title);
tabPanel.add(label2,tab2Title);
tabPanel.add(label3,tab3Title);
tabPanel.selectTab(0);
tabPanel.setPixelSize(400, 400);
popupProperties.add(tabPanel);
popupProperties.setAutoHideEnabled(true);
RootPanel.get().add(popupProperties);
popupProperties.center();
popupProperties.show();
我想为每个选项卡添加标签、网格、图表。 我怎样才能做到这一点?非常感谢。
最佳答案
如果你看到TabPanel的add()
的文档方法。
Convenience overload to allow IsWidget to be used directly.
所以任何 IsWidget 类型的对象,您可以添加它,无论它是图表、图形等....
关于java - 如何向 TabPanel GWT 添加多个小部件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25115104/