/** * Internal constructor for the {@code DataField} class. To create new * elements, see the static factory methods in {@code Field}. * * @param valueProperty The property that is used to store the current valid value * of the field. * @param persistentValueProperty The property that is used to store the latest persisted * @see Field ::ofStringType * @see Field ::ofIntegerType * @see Field ::ofDoubleType * @see Field ::ofBooleanType */ public DateField(ObjectProperty<LocalDate> valueProperty, ObjectProperty<LocalDate> persistentValueProperty) { super(valueProperty, persistentValueProperty); Chronology chronology = Chronology.ofLocale(Locale.getDefault(Locale.Category.FORMAT)); stringConverter = new LocalDateStringConverter(FormatStyle.SHORT, null, chronology); renderer = new SimpleDateControl(); userInput.setValue(null); userInput.setValue(stringConverter.toString((LocalDate) persistentValue.getValue())); }