void updateCaretPosition() { int x = getCursorX(); int y = getCursorY(); caretLeft = inputFont.substringWidth(vectorLines.elementAt(y).toString(), 0, x); }