Class DateStringConverter
java.lang.Object
javafx.util.StringConverter<Date>
javafx.util.converter.DateTimeStringConverter
javafx.util.converter.DateStringConverter
A StringConverter implementation for Date values that represent dates.
Note that using Date is not recommended in JDK versions where LocalDate is available, in which case
LocalDateStringConverter should be used.
- Since:
- JavaFX 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aDateStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the date style, and the user'sLocale.DateStringConverter(int dateStyle) Creates aDateStringConverterthat uses a formatter/parser based on the given date style, and the user'sLocale.DateStringConverter(String pattern) Creates aDateStringConverterthat uses a formatter/parser based on the given pattern, and the user'sLocale.DateStringConverter(DateFormat dateFormat) Creates aDateStringConverterthat uses the given formatter/parser.DateStringConverter(Locale locale) Creates aDateStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the date style, and the givenLocale.DateStringConverter(Locale locale, int dateStyle) Creates aDateStringConverterthat uses a formatter/parser based on the given date style andLocale.DateStringConverter(Locale locale, String pattern) Creates aDateStringConverterthat uses a formatter/parser based on the given pattern andLocale. -
Method Summary
Methods declared in class DateTimeStringConverter
fromString, toString
-
Constructor Details
-
DateStringConverter
public DateStringConverter()Creates aDateStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the date style, and the user'sLocale. -
DateStringConverter
public DateStringConverter(int dateStyle) Creates aDateStringConverterthat uses a formatter/parser based on the given date style, and the user'sLocale.- Parameters:
dateStyle- the formatting style for dates. For example,DateFormat.SHORTfor "M/d/yy" in the US locale.- Since:
- JavaFX 8u40
-
DateStringConverter
Creates aDateStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the date style, and the givenLocale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.
-
DateStringConverter
Creates aDateStringConverterthat uses a formatter/parser based on the given date style andLocale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.dateStyle- the formatting style for dates. For example,DateFormat.SHORTfor "M/d/yy" in the US locale.- Since:
- JavaFX 8u40
-
DateStringConverter
Creates aDateStringConverterthat uses a formatter/parser based on the given pattern, and the user'sLocale.- Parameters:
pattern- the pattern describing the date format. Ifnull,DateFormat.DEFAULTwill be used for the date style.
-
DateStringConverter
Creates aDateStringConverterthat uses a formatter/parser based on the given pattern andLocale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.pattern- the pattern describing the date format. Ifnull,DateFormat.DEFAULTwill be used for the date style.
-
DateStringConverter
Creates aDateStringConverterthat uses the given formatter/parser.- Parameters:
dateFormat- the formatter/parser that will be used by thetoString()andfromString()methods. Ifnull, a default formatter/parser will be used.
-