rich420
asked on
JTextField
Is there a type of Text Entry Field that only allows the user to enter numeric data, such as dates?
ASKER
thanks for that, but I couldn't find a JFormatTextField, or am I using the wrong version.
Did you mean JFormattedTextField? If so, How do I use JFormattedTextField to accept dates only?
Could I have a small example or explanation
Did you mean JFormattedTextField? If so, How do I use JFormattedTextField to accept dates only?
Could I have a small example or explanation
glottis is right.
for date u can use thre list box for dd, mm and yyyy and a script for validation
for date u can use thre list box for dd, mm and yyyy and a script for validation
ASKER
I am not allowed to have any validation scripts, because invalid characters should not even be allowed to be typed into the text field.
u r right, but i haven't any more idea
JFormattedTextField ftf = new JFormattedTextField();
ftf.setValue(new Date()); // for dates
ftf.setValue(new Integer(1)); // for numbers
if u study the JFormattedTextField u can add poissibly any type of format
ftf.setValue(new Date()); // for dates
ftf.setValue(new Integer(1)); // for numbers
if u study the JFormattedTextField u can add poissibly any type of format
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
else you can search for such components, or if u are a genius you can make one :P