Browse a Listing
Top > Java > Tips and Tutorials > Swing
Popular Tags
Free Script links
While the JFormattedTextField component looks like JTextField, it acts completely different. In the simplest case, you can provide an input mask like "(###) ###-####" for a telephone number, and it will not accept any input that doesn't follow that format. In more complicated cases, there is both a display formatter and an input formatter. For example, the default date formatter permits scrolling through the available months or days based upon where the cursor is located while editing.
When working with JFormattedTextField, acceptable input is either explicitly specified by the mask or specified by a value for the component. In the latter case, the component uses the Factory design pattern to look up the default formatters for the class of the specified value. The DefaultFormatterFactory component comes with preinstalled formatters for dates, numbers, java.text.Format subclasses, and a catchall formatter for everything else
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Oct 12, 2006 Hits: 7 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR
Member Reviews
Visitor Ratings
Google PR