The tag <HTML>also </HTML>indicates that the input file is in HTML. If you want to use HTML in Swing components, they must either not be HTML, or be completely in HTML. You can change the background of the text using a tag <FONT>, it can also be neatly wrapped your text in tags <P>, but this is still a question of taste.
Try using
String msg = "<HTML><BODY><P>Please fix <FONT style="BACKGROUND-COLOR: #FFCCCC"> this</FONT></P></BODY></HTML>";
source
share