Is it possible to initialize default value for DatePicker at FXML level?
<children>
<DatePicker fx:id="datePicker" value="2015-07-20"/>
<Label fx:id="messageLabel" textAlignment="JUSTIFY" />
</children>
Obviously that throws an exception, Is it possibly to call constructor of LocalDate?
For example:
<DatePicker fx:id="datePicker" value="LocalDate.of(2015,07,20)"/>
You can set default value of the date to today through controller. Following line worked for me.
datePicker.setValue(LocalDate.now());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With