I would interrupt input from keyboard when i write in jtextpane because before to write a character i would apply a style into a document and after insert this character. I do this with keyListener but every time i press one button on the keyboard the result is two character: one from System.in and one from listener with style.
I hope I explained myself Thanks