如何将html放入Java的JLabel中?
如何在Java的JLabel中使用html标签?
要将 html 放入 ,您会使其看起来像这样JLabel
JLabel label = new JLabel("<html><yourTagHere><yourOtherTagHere>this is your text</yourOtherTagHere></yourTagHere></html>");
这将解决问题:
String labelText ="<html><FONT COLOR=RED>Red</FONT> and <FONT COLOR=BLUE>Blue</FONT> Text</html>";
JLabel coloredLabel =new JLabel(labelText);