Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFormattedTextField with MaskFormatter for input integer

843805Apr 2 2007 — edited Apr 2 2007
I would like to create a input field for typing any integer number from 1 to 999 and I'm using JFormattedTextField with MaskFormatter("###").
But there is only accept 3 digital number. When i type a number between 1 to 99, it does not accept my number.
I also try JTextField with Numberformat, but user can type a non numeric value (such as "A","!" ....,etc)
so, how can I solve this problem?
thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2007
Added on Apr 2 2007
3 comments
72 views