Class TimeStringConverter
java.lang.Object
javafx.util.StringConverter<Date>
javafx.util.converter.DateTimeStringConverter
javafx.util.converter.TimeStringConverter
A StringConverter implementation for Date values that represent time.
Note that using Date is not recommended in JDK versions where LocalTime is available, in which case
LocalTimeStringConverter should be used.
- Since:
- JavaFX 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aTimeStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the time style, and the user'sLocale.TimeStringConverter(int timeStyle) Creates aTimeStringConverterthat uses a formatter/parser based on the given time style, and the user'sLocale.TimeStringConverter(String pattern) Creates aTimeStringConverterthat uses a formatter/parser based on the given pattern, and the user'sLocale.TimeStringConverter(DateFormat dateFormat) Creates aTimeStringConverterthat uses the given formatter/parser.TimeStringConverter(Locale locale) Creates aTimeStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the time style, and the givenLocale.TimeStringConverter(Locale locale, int timeStyle) Creates aTimeStringConverterthat uses a formatter/parser based on the given time style andLocale.TimeStringConverter(Locale locale, String pattern) Creates aTimeStringConverterthat uses a formatter/parser based on the given pattern andLocale. -
Method Summary
Methods declared in class DateTimeStringConverter
fromString, toString
-
Constructor Details
-
TimeStringConverter
public TimeStringConverter()Creates aTimeStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the time style, and the user'sLocale. -
TimeStringConverter
public TimeStringConverter(int timeStyle) Creates aTimeStringConverterthat uses a formatter/parser based on the given time style, and the user'sLocale.- Parameters:
timeStyle- the formatting style for times. For example,DateFormat.SHORTfor "h:mm a" in the US locale.- Since:
- JavaFX 8u40
-
TimeStringConverter
Creates aTimeStringConverterthat uses a formatter/parser based onDateFormat.DEFAULTfor the time style, and the givenLocale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.
-
TimeStringConverter
Creates aTimeStringConverterthat uses a formatter/parser based on the given time style andLocale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.timeStyle- the formatting style for times. For example,DateFormat.SHORTfor "h:mm a" in the US locale.- Since:
- JavaFX 8u40
-
TimeStringConverter
Creates aTimeStringConverterthat uses a formatter/parser based on the given pattern, and the user'sLocale.- Parameters:
pattern- the pattern describing the time format. Ifnull,DateFormat.DEFAULTwill be used for the time style.
-
TimeStringConverter
Creates aTimeStringConverterthat 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 time format. Ifnull,DateFormat.DEFAULTwill be used for the time style.
-
TimeStringConverter
Creates aTimeStringConverterthat 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.
-