How to parse numbers more strict than what NumberFormat does in Java?

后端 未结 7 949
挽巷
挽巷 2021-02-09 01:47

I\'m validating user input from a form.

I parse the input with NumberFormat, but it is evil and allow almost anything. Is there any way to parse number more strict?

相关标签:
7条回答
  • 2021-02-09 02:33

    I gave up on writing my own validation class, and went with NEBULA WIDGETS FormattedText

    It was written over the SWT widget API, but you can easily adapt the NumberFormatter class

    0 讨论(0)
提交回复
热议问题