2012-02-10 6 views

Respuesta

3

Puede usar HTML en JLabels, así que esto debería funcionar:

JLabel lbl = new JLabel("<html><span style='color: blue;'>My</span> <span style='color: red;'>Text</span></html>"); 
4

Pruebe con html:

String labelText = 
    "<html><FONT COLOR=BLUE>My</FONT>" + 
    "<FONT COLOR=RED>Text</FONT></html>"; 
JLabel lbl = new JLabel(labelText); 
Cuestiones relacionadas