### Create a Seperator

Example of creating Seperator which can be used in a Toolbar, Statusbar etc.
(Requires the JavaObject Library)
Solution 1
Pane Node defined in the B4J Visual Designer
Private Pane_ToolbarMain As Pane
Add a Separator to the Toolbar at positions Left 210, Top 0, Width 10, Height 40
Dim joS As JavaObject
joS.InitializeNewInstance("javafx.scene.control.Separator", Array("VERTICAL"))
Pane_ToolbarMain.AddNode(joS, 210, 0, 10, 40)
Solution 2
Nodes defined in the B4J Visual Designer (Add View > Pane)
Pane Toolbar
Private Pane_ToolbarMain As Pane
Pane Separator
Private Pane_Functions_Separator1 As Pane
The properties for the separator pane:
No border, vertical anchor set both, parent node Pane_ToolbarMain, width 10.
Sub to add a separator to the Toolbar
`Private Sub Separator_ToPane(p As Pane)
Dim joS As JavaObject
joS.InitializeNewInstance("javafx.scene.control.Separator", Array("VERTICAL"))
p.AddNode(joS, 0, 5, 10, 30)
End Sub`
Add the separator to the toolbar using previous sub
Separator_ToPane(Pane_Functions_Separator1)
Solution 3
Add a separator to a Toolbar created using JabaObject.
Define a sub to create the separator
`Private Sub Toolbar_Separator(Orientation As String) As JavaObject
Dim joSep As JavaObject
Return joSep.InitializeNewInstance("javafx.scene.control.Separator", Array(Orientation.ToUpperCase))
End Sub`
Add the separator to the toolbar
Private joToolbarFunctions As JavaObject
joToolbarFunctions.InitializeNewInstance("javafx.scene.control.ToolBar", Null)
joToolbarFunctions.RunMethodJO("getItems", Null).runMethod("add", Array(Toolbar_Separator("VERTICAL")))

Changed: , Category: Separator, File: T6C244M1771.htm, ID: 1771