P
Paul Tomblin
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.
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.