I have a JTextArea that has its text set to an information line. In this line of information, I have a variable that I would like to color red, for this I will edit the line as follows:
"Result: <html><font color=red>" + negativeValue + "</font></html>"
I expect this to yield Result: ##, where the number is red. However, it simply puts the following in the text area:
Result: <html><font color=red>##</font></html>
I'm not sure how to do this, so can someone advise how to do this?
source
share