SimpleDateFormat defaults to lenient date parsing (if it can find any way
of constructing a valid date from the entered date it will).  This
behaviour can be replaced with a stricter validation using
setLenient(false).



                                                                                       
                                
                    "Reynshteyn,                                                       
                                
                    Leonid"                  To:     "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>,                
                    <leonid.reynshtey        "'[EMAIL PROTECTED]'"  
                                
                    [EMAIL PROTECTED]>                <[EMAIL PROTECTED]>    
                                
                    Sent by:                 cc:     (bcc: Paul A McMahon/Qtech 
Business Systems/AU)                   
                    advanced-swing-ad        Subject:     Client-Side Date validation  
                                
                    [EMAIL PROTECTED]                                                         
                                
                                                                                       
                                
                                                                                       
                                
                    06/06/2001 05:10                                                   
                                
                    AM                                                                 
                                
                                                                                       
                                
                                                                                       
                                




Does anyone know of a way to validate that the date format entered by the
user in the JTextField corresponds to a specific date format. For example,
I
want to make sure that the user enters the date in this format:
"MM/dd/yyyy"
and the values of the date are valid. SimpleDateFormat class does not throw
exceptions unless the format used is totally incorrect, which is not good
enough.

Any ideas?

Thanks.
> _____________________________________________
> Lenny Reynshteyn
Firmwide Internet Group
Goldman, Sachs & Co.
> Tel: (212) 855-0332
Tel in 1 NYP: (917)343-1523 (no voicemail)
> Email: [EMAIL PROTECTED]
>
>
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing




_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to