private void setCaretValue(int i) { caret.setVisible(true); caretValue = i; int min = 0; int max = getText().length(); if (i < min) i = min; if (i > max) i = max; if (debug) System.out.println("setSelectionStart: " + i); setSelectionStart(i); setSelectionEnd(i); }
/** Only show the flashing caret if the selection range is zero */ @Override public void setVisible(boolean e) { if (e) e = getDot() == getMark(); super.setVisible(e); }