John,

On Wednesday, January 24, 2001, 1:20:51 AM, you wrote:

John> You need to set the background color of the content when you add
John> the text to the document model.  Fun attribute stuff found with
John> the text components.

John> I show how to work with this in my book.... ;-)

John> Code's available online at least at www.apress.com if you don't
John> have the book....

Don't wanna spoil John's day, of course, but you can easily have more
then one instance of DefaultHighlighter associated with the document
enclosed in any JTextComponent. This class implements the Highlighter
(interface) and you can feed it the offset/length parameters for your
highlighted fragments.

There's also DefaultHighlighter.DefaultHighlightPainter (inner class)
that does the painting - you can set color parameters etc there.

Hope this helps,
Sandor

-- 
ir A.G.L. Spruit, Utrecht University, the Netherlands
Institute of information and computing sciences
"There is a bit of magic in everything, and then some
loss to even things out" (from: Lou Reed, "Magic and Loss")


_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to