Okay so I figured out the whole color business using HTML, but now when I put it in my Jlabel its not working! Might it have anything to do with the fact that i am using getText() from a TextArea to set the text of my Jlabel? Here’s my code:
String air = "<html>\n" +
"<ul><font color=blue>blue</font>\n" +
"</ul>\n";
…
JLabel jl = new JLabel();
jl.setSize(700,700);
frame.add(jl);
jl.setText(environment.getText());
I get this….
<html><ul><font color=blue> text </font></ul>
I tried your code and it’s work properly.
Can you post complete code ? Are you running java applet ?
I found similar issue in here : HTML no longer working in JLabel (and other components).
Hope it’s can help you.
}