Skip to main content

to put date and time by user

3 replies [Last post]
niveditajain2002
Offline
Joined: 2011-08-19

Is there any method or constraint to be put on textfield, So that user can put date and time in text field

Format should be DD/MM/YY HH:MN

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

No. Currently we only have the calendar and Spinner class.

This is a problematic area which I hope to improve on for a future revision.

niveditajain2002
Offline
Joined: 2011-08-19

Ok. So is there any feature in textfield so that , after entering 2 digits, we automatically put a "/" so that next 2 digits will be for month??

vprise
Offline
Joined: 2003-11-07

Yep. You can use data change listener to track text field changes and move the cursor/setText to whatever you like. You can also derive text field and override some methods such as insertChar etc.