CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2000
    Posts
    2

    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.


  2. #2
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    5

    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.

  3. #3
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    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
  •  





Click Here to Expand Forum to Full Width

Featured