Underline StyleConstant in a different colour with AttributeSet

后端 未结 1 707
南方客
南方客 2021-01-27 03:31

I am implementing a spellchecker and wondered if there is an easy/obvious way of underlining some text in a different colour such as Red.

I have everything set up and u

相关标签:
1条回答
  • 2021-01-27 04:21

    Use e.g this http://java-sl.com/tip_colored_strikethrough.html

    Just modify it a bit to achieve underline rather than strikethrough.

    But from my experience to highlight spellcheck errors it's better to define custom highlight painter

    See also http://www.java2s.com/Code/Java/Swing-JFC/JTextPaneHighlightExample.htm

    0 讨论(0)
提交回复
热议问题