|
-
September 24th, 2000, 12:59 PM
#1
Accepting Date in jTextField
I want to accept only the Date in a suitable format in the jTextField. If the user enters anything else than Date, I should display a error message. I would really appreciate if anyone help me in giving me a suitable solution. Same thing even for number also.
-
September 29th, 2000, 05:07 AM
#2
Re: Accepting Date in jTextField
Hi,
The most efficient way is having a drop down menu instead of JText field..U can hard code the numberdate,month name,year..
Thats efficient.
Otherwise answering for ur question...
Get the text entered from the text field by getText() and check whether it is an int..
Otherwise display an error message
Hope this helps
Regards
Praveen
When going gets tough,
Tough gets going.
-
October 1st, 2000, 03:05 PM
#3
Re: Accepting Date in jTextField
Well... I had developed a reusable component for this. Its name is JDateTextField. It is posted on this site under java swing section.
See if it suites your needs.
- UnicMan
http://members.tripod.com/unicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|