Highlight current row in JTextPane

后端 未结 3 1587
别那么骄傲
别那么骄傲 2021-02-08 21:21

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

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 21:43

    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

提交回复
热议问题