I\'m trying for more than 2 days to implement a specific requirement for a text editor window... unfortunately without success so far :(
The goal is to get a text editor
http://tips4java.wordpress.com/2008/10/29/line-painter/
I think this is what you are looking for. I took that LinePainter class and copied your constructor over into a main method, took out your highlighter parts and added a new LinePainter(textPane); Works like a charm
LinePainter
new LinePainter(textPane);