I l@ve RuBoard |
![]() ![]() |
20.6 The DateFormatter ClassDateFormatter is a subclass of InternationalFormatter that uses an object of type java.text.DateFormat as its format. JFormattedTextField instantiates a DateFormatter for itself if you pass a java.util.Date or a java.text.DateFormat into its constructor. With a java.util.Date, the format is localized to the default locale. This is usually what you want, but if you want your program to use the same date format no matter where in the world it is run, construct your JFormattedTextField with a specific java.text.DateFormat. Most of the DateFormatter implementation is concerned with providing support to increment and decrement subfields of any date from the keyboard. It does a nice job with this. If you haven't done so yet, you might want run the SimpleFTF program and play with the date field. 20.6.1 PropertiesDateFormatter does not define any properties beyond those it inherits (see Table 20-6). The minimum and maximum properties can be handy if you want the field to be restricted to a specific range of dates. 20.6.2 Constructors
|
I l@ve RuBoard |
![]() ![]() |