wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Use mask formatter in conjunction with a DateFormatter in Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Use mask formatter in conjunction with a DateFormatter in Swing" Watch "Use mask formatter in conjunction with a DateFormatter in Swing" New topic
Author

Use mask formatter in conjunction with a DateFormatter in Swing

Theodore David Williams
Ranch Hand

Joined: Dec 21, 2009
Posts: 102
I have a date field in a swing gui and the user would like not to have to enter the '/' 's between the date and the ':' ' s between the time.

If I use a JFormattedTextField with a date formatter i.e.

Then I have the ability to format date correctly but I have to enter the "/' 's and the ":" 's maunally

If I use a FormattedTextField with a MaskFormatter i.e.


Now the user will not have to enter /'s or :'s but I imagine that I lose some of what the date formatter will give me right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use mask formatter in conjunction with a DateFormatter in Swing