0

I need a textfield used for a date input, with fixed separators in order to help the user check the date he is writing. I need it to come as default with "-" separators between date month and year: xx-xx-xxxx, when x is just spaces at the begining, but after the user input something like: 03-05-1992. How can i get this? Thanks

mKorbel
  • 109,525
  • 20
  • 134
  • 319
El pocho la pantera
  • 505
  • 1
  • 5
  • 17

1 Answers1

2

Use a JFormattedTextField with SimpleDateFormat and MaskFormatter, example here.

Community
  • 1
  • 1
Sam Marsh
  • 166
  • 2
  • 6