void (@NotNull DocumentEvent e) { if (inSync) return; inSync = true; String s = "<invalid>"; JTextField f = null; try { if (e.getDocument() == myField.getDocument()) { f = myOffsetField; Coordinates p = getCoordinates(); s = p == null ? s : String.valueOf(coordinatesToOffset(p)); } else { f = myField; int offset = StringUtil.parseInt(myOffsetField.getText(), -1); Coordinates p = offset >= 0 ? offsetToCoordinates(Math.min(getMaxOffset() - 1, offset)) : null; s = p == null ? s : String.format("%d:%d", p.row + 1, p.column + 1); } f.setText(s); } catch (IndexOutOfBoundsException ignored) { if (f != null) f.setText(s); } finally { inSync = false; } }