JTextField that has inner fields or preformated format, something like the ip field in windows

Posted by dimitar on Stack Overflow See other posts from Stack Overflow or by dimitar
Published on 2010-06-06T19:23:33Z Indexed on 2010/06/06 19:52 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

Hello guys, i want to create a text field that will be for date and will have dd.mm.YYYY format. Now what i want to do is the user to type only the numbers, not the dots to. So the field would be like: _ _. _ _ . _ _ _ _

So when the user wants to type the date: 15.05.2010 for example, he will only type the numbers in the sequence 15052010.

Also i would like, when he preses on left or right arrow, the cursor to go from one field(not JTextField, but field in the JTextField). So lets say i have JTextField with text in it: 15.05.2010, so if user is on the beginning and he preses right arrow, the cursor to go to the .05 field.

I hope you understand me 'cos right now i don't any idea how to make this, or at least how to look for it on google.

Thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about format