### Set DatePicker Value

As from B4J v4.00 the B4J Visual Designer includes a DatePicker View.
`Sub Process_Globals
Private DatePicker1 As DatePicker
...
End Sub`
Set the DatePicker Date
'Use the library DateUtils to set a date in the datepicker
DatePicker1.DateTicks = DateUtils.SetDate(2018,1,1)
(Not recommended) Using API methods
Set the DatePicker Value by using a JavaObject to convert a date as string into the new Java 8 Date Format.
Reference: http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/DatePicker.html
Reference: http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html
Process_Globals
Private DatePicker1 As Node
End Sub
'Set dateformat - IMPORTANT to use this format
DateTime.DateFormat = "yyyy-MM-dd"
'Set the date to be displayed in the DatePicker
Dim date As String = DateTime.Date(DateTime.Now)
'Define a JavaObject holding the new Java 8 Date
Dim joLD As JavaObject
joLD.InitializeStatic("java.time.LocalDate")
Try
Dim joDP As JavaObject = DatePicker1
joDP.RunMethod("setValue",Array As Object(joLD.RunMethod("parse", Array As Object(date))))
Catch
Log(LastException.Message)
End Try

Changed: , Category: DatePicker JavaFX 8, File: T6C182M1316.htm, ID: 1316