How can I capture and modify the value of the key pressed before it will be displayed in the TextArea ?

Sandip Chitale

  1. override processKeyEvent()
  2. recreate another KeyEvent with all parameters same as the original KeyEvent except for the value.
  3. call consume() on the original KeyEvent.
  4. now call super.processKeyEvent(newKeyEvent).