title: Document filter is not working in Java?
body: <p>In text field more than 10 characters na, it has to show an error. For that i used document filter:</p>
  
  <pre><code>JTextField field = (JTextField) txtFld;
  AbstractDocument document = (AbstractDocument) field.getDocument();
  document.setDocumentFilter(new DocumentSizeAndUppercaseFilter(10));
  </code></pre>
  
  <p>So this is my document filter coding. I registered the textfield through document filter. But nothing has happening here. How to use document filter?</p>
  
  <p>DocumentSizeAndUppercaseFilter class which has the error msg.</p>