0

How can I create an uneditable date formatted (00/00/0000) textfield in JAVA, which allows user to type only numbers

Numbers allowed in the first offset - 0-3
Numbers allowed in the second offset - 0-9
"/" in the third offset should not be deleted
Numbers allowed in the fourth offset - 0,1
Numbers allowed in the fifth offset - 0-9
"/" in the sixth offset should not be deleted
Number allowed in the seventh offset - 2
Number allowed in the eighth offset - 0
Number allowed in the ninth offset - 0
Numbers allowed in the tenth offset - 6-9

textfield MUST not allow the user to delete both zero and slash(/)

Need Urgent help....
:sad:

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by jwenting
0

>How can I create an uneditable date formatted (00/00/0000) textfield in JAVA, which allows user to type only numbers...

I'm not sure whether you could do that immediately at the time the users types in the date. This is just a guess. I'm probably be proved wrong yet again :lol:.


However, you could introduce a submit button, which would then parse the input the user has entered and return a success message if the input satisfies your criteria.

0

Of course you can. Add a KeyListener which rejects all non-numeric formats and inserts the slashes as needed :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.