Validation For JFormattedTextField
Hi,
In my application we have JFormattedTextField to enter amount or Budget.
I need to restrict the size(min-max 4-15 characters) as well as check the Input characters entered in the JFormattedTextField.
I have written code like this:
MaskFormatter formatter = new MaskFormatter("***************");
formatter.setValidCharacters("0123456789Rs./-$");
t1 = new JFormattedTextField(formatter);
It is accepting specified characters but if I enter characters lessthan 15 it is showing error.please help me regarding this.
Thanking You.
|