List of usage examples for java.awt.event KeyEvent setKeyChar
public void setKeyChar(char keyChar)
From source file:Main.java
public static void main(String[] argv) throws Exception { KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() { public boolean dispatchKeyEvent(KeyEvent e) { if (e.getID() == KeyEvent.KEY_TYPED) { e.setKeyChar('a'); }/*from ww w.j av a2s. c o m*/ boolean discardEvent = false; return discardEvent; } }); }