how can i replace a tab of TabPanel with another text.
in the following code i want to replace text4 in tab one.
in other word when a tab show’s a widget (like text1) how can i change its content with another widget (like text4)
public void onModuleLoad() {
String text1 = "1111111111111111111111111111 ...";
String text2 = "2222222222222222222222222222...";
String text3 = "3333333333333333333333333333...";
String text4 = "4444444444444444444444444444...";
TabPanel panel = new TabPanel();
FlowPanel flowpanel;
flowpanel = new FlowPanel();
flowpanel.add(new Label(text1));
panel.add(flowpanel, "One");
flowpanel = new FlowPanel();
flowpanel.add(new Label(text2));
panel.add(flowpanel, "Two");
flowpanel = new FlowPanel();
flowpanel.add(new Label(text3));
panel.add(flowpanel, "Three");
panel.selectTab(0);
/* in this line exactlly , How can i raplace text4 in tab(one) */
panel.setSize("500px", "250px");
panel.addStyleName("table-center");
RootPanel.get("demo").add(panel);
}
The simple way is keep label1 and change the value whenever you want
If you didn’t do this then you can do it like that :