-
JTextPane refresh problem under jdk 1.1.8 swing 1.1.1
Salutation,
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
textPane.invalidate();
textPane.validate();
textPane.repaint();
-------------------
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
vail.
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|