I'm writing custom processKeyEvent(KeyEvent e)
.
First of all I want only digits to be processed, so my function looks like this:
@Override
public void processKeyEvent(KeyEvent e) {
if (Character.isDigit(e.getKeyChar())) {
super.processKeyEvent(e);
}
e.consume();
}
but standard text operations such as delete, copy/paste, backspace etc. don't work. Is there way to allow them through my if-filter in a smarter manner than defining them one by one manually?