예제 #1
0
 public void focusGained(FocusEvent e) {
   inModalMode = true;
   if (debug) System.out.println("gained focus");
   setBlinkRate(500);
   // setCaretValue(caretValue);
   super.focusGained(e);
 }
예제 #2
0
  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);
  }