replaceText(index, index, s);
try { doc.insertString(index, s, null); } catch (BadLocationException ex) {  ex.printStackTrace(); }
    public void insertTextAtIndex(int index, String s)      throws NotImplementedException    {      replaceText(index, index, s);    }