public void replace(FilterBypass filterBypass, int offset, int length, String string, AttributeSet attributeSet)
         throws BadLocationException {
      super.replace(filterBypass, offset, length, string, attributeSet);
      Document doc = filterBypass.getDocument();
      _preText = doc.getText(0, doc.getLength());
      _firstSelectedIndex = -1;

      for (int i = 0; i < getCompleterListSize(); i++) {
         String objString = getCompleterObjectAt(i).toString();

         if ((_case) ? objString.equals(_preText) : objString.equalsIgnoreCase(_preText)) {
            _firstSelectedIndex = i;

            if (_corrective)
               filterBypass.replace(0, _preText.length(), objString, attributeSet);
            break;
         }

         if (objString.length() <= _preText.length())
            continue;

         String objStringStart = objString.substring(0, _preText.length());

         if ((_case) ? objStringStart.equals(_preText) : objStringStart.equalsIgnoreCase(_preText)) {
            String objStringEnd = objString.substring(_preText.length());
            if (_corrective)
               filterBypass.replace(0, _preText.length(), objString, attributeSet);
            else
               filterBypass.insertString(_preText.length(), objStringEnd, attributeSet);

            getTextField().select(_preText.length(), doc.getLength());
            _firstSelectedIndex = i;
            break;
         }
      }
   }