### Remove Item

For methods that are not exposed, use the API methods via JavaObject (requires the JavaObject library).
This example uses the method getItems which returns a list of SplitPane items. A item is removed from the list, i.e. SplitPane.
Example SplitPane getItems
A mainform has a splitpane with two layouts (created with the B4J Internal Designer) loaded.
Private MainForm As Form
Private splitMain As SplitPane
...
MainForm = Form1
MainForm.RootPane.LoadLayout("Main") 'Main.bjl
splitMain.LoadLayout("PaneLeft") 'PaneLeft.bjl
splitMain.LoadLayout("PaneRight") 'PaneRight.bjl
To get the number of SplitPane items:
Dim joSplitPane As JavaObject = splitMain
'Get the splitpane items as a list
Dim l As List = joSplitPane.RunMethod("getItems", Null)
Log(l.Size) '2
As the result is a list, the list methods can be applied (see next).
Example SplitPane Remove Item
In the previous example, the splitpane has 2 items.
To remove the second item with index 1, use
Dim joSplitPane As JavaObject = splitMain
'Get the splitpane items as a list
Dim l As List = joSplitPane.RunMethod("getItems", Null)
Log(l.Size) '2
If l.size > 1 then l.RemoveAt(1)
Log(l.Size) '1
Note:

Changed: 2018-04-01 10:21, Category: SplitPane, File: T6C253M2153.htm, ID: 2153