To programmatically select a tab of a Codename One Tabs object, the following code is enough:
tabs.setSelectedIndex(tabToSelect, true);
The problem is that this code selects the wanted tab but it doesn't horizontally scroll the tabs buttons container to make the tab name visible (if it's not visible because there are many tabs). Note that I'm using the theme constant tabsGridBool: false;.
Because of this issue, I tried to solve so:
tabs.setSelectedIndex(tabToSelect, true);
tabs.scrollComponentToVisible(tabs.getTabsContainer().getComponentAt(tabToSelect));
but it doesn't work. What is a proper way to select a tab and its button? Thank you