Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text size and color in JLabel

Status
Not open for further replies.

MoreFeo

Technical User
Joined
Nov 29, 2002
Messages
547
Location
ES
Hi, is there a way to change the text size and color in a JLabel? Thanks in advance
 
2 ways:
1.label.setText(&quot;<html><h1><color='red'>&quot; + yourtext);
2.label.setFont(new Font(&quot;Helvetica&quot;,Font.PLAIN,14));
label.setForeground(Color.red);
 
thanks a lot, I'll try it at home.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top