title: Java textfield validation
body: <p>I have to validate a java <code>text field</code> which takes only integer values with a maximum length of 10. Entering of other values must be skipped.</p>
  
  <p>I tried this as following. on that case i cant typed full stop.</p>
  
  <pre><code>private void jTextField2KeyTyped(java.awt.event.KeyEvent evt) {                                     
          char c = evt.getKeyChar();
  
          if(!(Character.isDigit(c) || (c==KeyEvent.VK_BACK_SPACE)||(c==KeyEvent.VK_STOP ) )){
              getToolkit().beep();
  
              evt.consume();
  
              }
  
      }          
  </code></pre>