/** * Called when a key is typed. */ public void keyTyped(KeyEvent e) { int keyChar = e.getKeyChar(); if (keyChar == 0x8 /* KeyEvent.VK_BACK_SPACE */) { if (outputMark == getCaretPosition()) { e.consume(); } } else if (getCaretPosition() < outputMark) { setCaretPosition(outputMark); } }
/** * Called when a key is typed. */ public void keyTyped(KeyEvent e) { int keyChar = e.getKeyChar(); if (keyChar == 0x8 /* KeyEvent.VK_BACK_SPACE */) { if (outputMark == getCaretPosition()) { e.consume(); } } else if (getCaretPosition() < outputMark) { setCaretPosition(outputMark); } }
/** * Called when a key is typed. */ public void keyTyped(KeyEvent e) { int keyChar = e.getKeyChar(); if (keyChar == 0x8 /* KeyEvent.VK_BACK_SPACE */) { if (outputMark == getCaretPosition()) { e.consume(); } } else if (getCaretPosition() < outputMark) { setCaretPosition(outputMark); } }
int code = e.getKeyCode(); if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) { if (outputMark == getCaretPosition()) { e.consume(); int caretPos = getCaretPosition(); if (caretPos == outputMark) { e.consume();
int code = e.getKeyCode(); if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) { if (outputMark == getCaretPosition()) { e.consume(); int caretPos = getCaretPosition(); if (caretPos == outputMark) { e.consume();
int code = e.getKeyCode(); if (code == KeyEvent.VK_BACK_SPACE || code == KeyEvent.VK_LEFT) { if (outputMark == getCaretPosition()) { e.consume(); int caretPos = getCaretPosition(); if (caretPos == outputMark) { e.consume();