开发者

setting multiple highlighters to a jeditorpane

开发者 https://www.devze.com 2023-04-01 08:19 出处:网络
I want to know whether we can set two highlighters to a JEditorpane using sethighl开发者_Go百科ighter(new Highlighter()) method where one is a default highlighter and the other is a underline highligh

I want to know whether we can set two highlighters to a JEditorpane using sethighl开发者_Go百科ighter(new Highlighter()) method where one is a default highlighter and the other is a underline highlighter.


Rectangle Painter shows an example of creating a custom HighlightPainter. You should be able to modify it to just do an underline.


You can use one highlighter but adding highlights with another HighlightPainter to paint your underline.

public Object addHighlight(int p0, int p1, HighlightPainter p) throws BadLocationException;
0

精彩评论

暂无评论...
验证码 换一张
取 消