AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some questions about JFormattedTextField

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Paul Tomblin
Guest





PostPosted: Sat Jan 22, 2005 3:31 am    Post subject: Some questions about JFormattedTextField Reply with quote



I tried posting this to .programmer, but didn't get any answers so I'm
trying here.

I've been working my google fingers to the bone over this one, as well as
writing lots of experimental code.

In Java 1.4 JFormattedTextField:

1. Why doesn't the date formatter act like MaskFormatter and automatically
put the separator character as you type? Is there a way to change that?

I'm getting the date formatter using
dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
DateFormatter df = new DateFormatter(dateFormat)
JTextField startDate = new JFormattedTextField(df);

2. Is there a good way to input HH:MM:SS durations rather than dates? I'm
using a MaskFormatter, but of course it doesn't stop you from entering
from entering a duration of 55:66:77. I suppose I could use an
InputVerifier? I though about using a DocumentListener but I don't see
any way to refuse to take input if they enter a digit greater than 5 in
the 4 or 6th positions.

3. Going back to DateFormatter again, is there a way to make it stop
taking invalid dates? I can put 99/99/2005 into one and it returns a date
of 6/7/2013. I'd rather it refused to take it, preferably interactively
rather than waiting for the focus lost event.

--
Paul Tomblin <ptomblin (AT) xcski (DOT) com> http://xcski.com/blogs/pt/
I hate mornings. I know they hate me back, too.
-- Joel Gluth
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.