private void TxtFieldKeyTyped(java.awt.event.KeyEvent evt) { int typedchar = evt.getKeyChar(); if(!(Character.isDigit(typedchar)|| typedchar== KeyEvent.VK_BACK_SPACE || typedchar== KeyEvent.VK_DELETE) || TxtField.getCaretPosition() > 6){ evt.consume(); } } private void TxtFieldKeyPressed(java.awt.event.KeyEvent evt) { // TODO add your handling code here: if(evt.getKeyCode()==KeyEvent.VK_ENTER ){ fieldValidate(); //FUnction to validate user input } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)