I have a JTextPane under the content type "text/plain". I use the
setCharacterAttributes to change the attributes of a portions of a text.


DefaultStyledDocument doc = (DefaultStyledDocument) textPane.getDocument();
doc.setCharacterAttributes(offset, length, activeAttribute, false);

// Refresh the display the hard way


When i do so, the text disapear (it takes the color of the background, in my
case white). If i reselect the text with my mouse the text reapear with the
proper attributes. I tried to refresh the JTextPane component but to no

Under jdk 1.2.2 and jdk 1.3 i don't have that particular issue (so it's
mostly a swing 1.1.1 problem as far as i can see).

Is there a solution to force a refresh everytime i change the attributes of
the text in the JTextPane?

Thank you in advance,

Francois Belair