How to highlight part of a JLabel?

前端 未结 3 1726
没有蜡笔的小新
没有蜡笔的小新 2021-01-11 22:06

Before any one suggests HTML, I explain later why thats not an option here. I have a table that contains a column with text cells in it. I need to be able to highlight some

3条回答
  •  遥遥无期
    2021-01-11 22:49

    Can't resist to throw the SwingX renderer decoration mechanism into the ring: its way to solve the requirement is to implement a Highlighter doing it. Which in fact is already done (though not yet in the officially supported) but hidden in the SwingLabs-Demos project, named X/MatchingTextHighlighter (you would need both) and recently fixed to cope with icons, RToL-ComponentOrientation, alignment, ellipses ..

提交回复
热议问题