When I select a piece of text in a JTextArea, it gets coloured in white and highlighted in blue (I’m using Nimbus LookAndFeel).
I changed it so the highlight is white, and the text also remains in black, so it is not noticed. What I want now is to get the text in bold when the user highlights it.
Is there any easy way to do this? Would it work if I create a listener for double-click, or would the text get bold but not highlighted at all?
See
DefaultHighlightersourceInner class
DefaultHighlightPainterhas methodYou can specify font there. Just call setFont() for the Graphics instance.
NOTE: bold font could have different widht so you should use font like “Monospaced”