0

I am trying to create a text field that at first contains only underscores and dashes, in which the user will enter numbers, for entering social security numbers. Every time the user enters a character, the underscore in the string will be replaced with that number, for example, ___-__-____ then xxx-__-____, xxx-xx-____, but the dashes will not be replaced, instead skipped over.I'm really stuck on this, and any help at all is appreciated.

sdeole8264
  • 21
  • 1

1 Answers1

1

Use JFormattedTextField. For details go through this tutorial.

Masudul
  • 21,823
  • 5
  • 43
  • 58