B4J Code Snippet Make Tab Pane Tabs (Almost) Fit The Width Of The Tab Pane

B4X:
Sub MakeTabsFillWidthOfTabPane(TabPaneToChange As TabPane)
    Dim JOTabPane As JavaObject = TabPaneToChange
    JOTabPane.RunMethodJO("tabMinWidthProperty",Null).RunMethod("bind",Array(JOTabPane.RunMethodJO("widthProperty",Null).RunMethodJO("divide",Array(JOTabPane.RunMethodJO("getTabs",Null).RunMethod("size",Null))).RunMethod("subtract",Array(30))))
 
End Sub
Need to call from the resize event of the tab pane and each time a tab is added or removed.


tabpane.png
[
 
Top