### Slider additional Properties

Setting additional properties for the B4J Visual Designer Slider View, can be accomplished by making use of API methods via a JavaObject (requires the JavaObject library).
Reference: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Slider.html
Create the Slider
The slider is added via the B4J Visual Designer
`Sub Process_Globals
...
Private Slider1 As Slider
...
End Sub`
Set Additional Properties
'Assign a JavaObject as Slider
Dim joSlider As JavaObject = Slider1
'Set additional properties which are not provided by the B4J Visual Designer
joSlider.RunMethod("setBlockIncrement", Array(10.0)) ' Must be double
joSlider.RunMethod("setMajorTickUnit", Array(10.0)) ' Must be double
joSlider.RunMethod("setMinorTickCount", Array(20)) ' Must be Int
joSlider.RunMethod("setShowTickLabels", Array(True))
joSlider.RunMethod("setShowTickMarks", Array(True))
joSlider.RunMethod("setValueChanging", Array(True))
joSlider.RunMethod("setSnapToTicks", Array(True))
Set Additional Properties Subs
' Value must be double
`Private Sub Slider_SetBlockIncrement(Sldr As Slider, Value As Double)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setBlockIncrement", Array(Value))
End Sub`
' Value must be double
`Private Sub Slider_SetMajorTickUnit(Sldr As Slider, Value As Double)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setMajorTickUnit", Array(Value))
End Sub`
' Value must be Int
`Private Sub Slider_SetMinorTickCount(Sldr As Slider, Value As Int)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setMinorTickCount", Array(Value))
End Sub`
`Private Sub Slider_SetShowTickLabels(Sldr As Slider, Value As Boolean)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setShowTickLabels", Array(Value))
End Sub`
`Private Sub Slider_SetShowTickMarks(Sldr As Slider, Value As Boolean)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setShowTickMarks", Array(Value))
End Sub`
`Private Sub Slider_SetValueChanging(Sldr As Slider, Value As Boolean)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setValueChanging", Array(Value))
End Sub`
`Private Sub Slider_SetSnapToTicks(Sldr As Slider, Value As Boolean)
Dim joSlider As JavaObject = Sldr
joSlider.RunMethod("setSnapToTicks", Array(Value))
End Sub`

Changed: 2018-04-28 18:35, Category: Slider, File: T6C249M1802.htm, ID: 1802