[program-java] date validation

Jim:

 

Do you have a date validation routine?

I have one, it's ugly enough. It checks the value of the month, then the
value of the day, compares it with the array of valid values.

I need more professional one, that uses Java classes.

 

I was also looking for a numeric field validation, but just found one.

And want to share it with our people.

It's neat, isn't it?

I'm looking for a date validation routine in the similar style.

 

Thank you and the code follows.

Anna 

 

  int number=0;   

      while (number == 0) {   

    String input=JOptionPane.showInputDialog("\n\tEnter numeric value.");   

    try{   

number=Integer.parseInt(input);   

    }catch(NumberFormatException nfe)   

    {   

Number = 0;   

    }   

 

Other related posts: