### DatePicker add using JavaObject

Example of adding a DatePicker to the MainForm via a JavaObject (requires the JavaObject library).
Reference:http://javafx.scene.control.DatePicker
Note:
As from B4J v4.00 a DatePicker View is available.
'Define the DatePicker JavaObject
Private joDatePicker As JavaObject
'Create a DatePicker and add to the mainform
'Define JavaObject (requires the JavaObject library) Private joDatePicker As JavaObject
`Sub CreateDatePicker
'Init the datepickerobject
joDatePicker.InitializeNewInstance("javafx.scene.control.DatePicker", Null)
MainForm.RootPane.AddNode(joDatePicker, 0, 0, -1, -1)
'Set some properties
joDatePicker.RunMethod("setShowWeekNumbers", Array As Object(True))
'Set actual date
Dim joLD As JavaObject
joLD.InitializeStatic("java.time.LocalDate")
joDatePicker.RunMethod("setValue", Array As Object(joLD.RunMethod("now", Null)))
End Sub`
'Get the selected datevalue and set as text to a Label View
`Sub ButtonDatePicker_Action
LabelDatePicker.Text = joDatePicker.RunMethod("getValue", Null)
End Sub`

Changed: , Category: Visual Designer, File: T6C276M2039.htm, ID: 2039