List of utility methods to do JTextComponent Key
void | addKeyBindings(final JTextComponent comp) _more_ comp.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (!e.isControlDown()) { return; int pos = comp.getCaretPosition(); if (e.getKeyCode() == e.VK_B) { if (comp.getCaretPosition() > 0) { ... |
void | sendKeyPress(JTextComponent target, int v_key, int modifiers) Create and send a KeyPress KeyEvent to the component given KeyEvent ke = new KeyEvent(target, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), modifiers, v_key,
KeyEvent.CHAR_UNDEFINED);
target.dispatchEvent(ke);
|