-1

Is there any library that can check my jtextarea the right input time format?

for example the input format must be hh:mm:ss or hh:mm only.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Kelvz
  • 163
  • 1
  • 1
  • 13

2 Answers2

2

Not sure why you want to use a JTextArea for this, as it's really designed to allow the user to type free text.

Normally you would use a DocumentFilter and for more examples

Other options would include the use for a JFormattedTextField or JSpinner

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
2

You can use a JFormattedTextField with MaskFormatter, as shown in this question: JFormattedTextField with MaskFormatter

Community
  • 1
  • 1
angel_navarro
  • 1,757
  • 10
  • 11