Setting Caption and Icon on a tabsheet does not seem to work on JAVA

Setting Caption and Icon on a tabsheet does not seem to work on JAVA it works if I do it on the descriptor… but from java code i cant do something like

    tabUsuarios.setIcon(icons.get(CubaIcon.WARNING));
    tabUsuarios.setCaption("TEST");

thank you for the support

Hello @eparamo ,

The right way to set icon and caption to Tab from Java is the following:

@Inject
private TabSheet tabSheet;

@Subscribe
public void onInit(InitEvent event) {
    TabSheet.Tab tab = tabSheet.getTab("tab");
    tab.setIconFromSet(CubaIcon.WARNING);
    tab.setCaption("Tab caption");
}

If you inject a specific tab from TabSheet in the controller will be injected the content of this tab (with VBoxLayout type).

thank you !