i have some issue with TabSheet, i add 2 tabs, tab1 & tab2 and when i click on tab2 tab bar, tabsheet.getTabIndex() still return 0 (i expected 1) , what i missed ? i just want the index clicked on the tab bar, how can retrieve this index ?
The getTabIndex() is rather easily misleading in TabSheet, as it has nothing to do with TabSheet tabs, but keyboard focus tabs. When you press the Tab key on the keyboard, it moves focus from one component to another. The tab index is used to control the focus sequence when pressing the Tab key. It’s defined in the Component.Focusable interface.
I guess a getTabPosition(Component) might be reasonable to have in addition to the getTabPosition(Tab). The Tab objects are not Components, so it should not be a problem.