I am developing an editor in java.I am using Htmleditorkit.I will be pasting text which contains hyperlink from ms word into my jtextpane.When i paste text from word to jtextpane i want it to remove the hyperlinks.Can anyone suggest me a solution. How can i remove all the hyperlinks at once.

I did try to get the href attributes of the pasted text and then remove the href attribute and then paste the text again in htmleditorkit,however it does not work.

MutableAttributeSet attr = kit.getInputAttributes();
attr.removeAttribute("HTML.Attribute.HREF");

I try to set it with new attributes-
StyleConstants.setFontFamily(attr,"Arial");
StyleConstants.setFontSize(attr,13);
StyleConstants.setForeground(attr,Color.BLACK);
setParagraphAttributes(editor, attr, true);

Can anyone please guide me for the same.Thanks and regards in advance.