Does anyone know of a Highlighter class I can use with JTextArea for HTML code?

Recommended Answers

All 4 Replies

I'm confused, do you want the text to be:

more than one color,
the text to be covered in a yellow like color as if highlighted,
or just be a different color other than black

sorry i didn't see the html code part, so u want it to be similar to JLabel where u can put html code in there? or just to do some syntax hightlighting?

lol, just added two more cases to the previous

syntax highlighting. I haven't found to much online about creating one in java.

I think you must use a simple parser...
another (but heavy) solution is the use of regular expressions

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.