Hi guys,
I need to create a text box in Java that only allows the user to input a date in the format ("dd/MM/yyyy"). How can I make this happen using a the tools available on the netbeans SDK?
Thanks,
James
Printable View
Hi guys,
I need to create a text box in Java that only allows the user to input a date in the format ("dd/MM/yyyy"). How can I make this happen using a the tools available on the netbeans SDK?
Thanks,
James
What technology are you using? Is this a swing application, a web application or anything else?
Using netbeans. I think it's swing?
You will just need to validate the user's input after they type it. Just read what they typed into the field, you can validate it with a regular expression, and then either toss an error or accept it.
Using the Swing library you can take a look at JSpinner component. This component allows you to get input of date and time values.