🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8472

JTextPane refresh problem under jdk 1.1.8 swing 1.1.1

#8472
From: Fran�ois B�lair
Date: Sat, 26 Aug 2000 00:00
30 lines
1554 bytes
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
Technical Details
Message-ID: <8o90t3$23h6@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,aa9b35481931ba04,start
X-Google-Attributes: gid111d45,public
From: "Fran�ois B�lair" <belair@orbitek.com>
Subject: JTextPane refresh problem under jdk 1.1.8 swing 1.1.1
Date: 2000/08/26
Message-ID: <8o90t3$23h6@bornews.borland.com>
X-Deja-AN: 662789169
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Reply-To: "Fran�ois B�lair" <belair@orbitek.com>
Newsgroups: borland.public.jbuilder.java.swing