
-----------------------------------
rated
Fri May 22, 2009 7:48 pm

HOW to set font size and color for JButton?
-----------------------------------
I am using setText to label my JButtons. Is there any way I can specify the font size and color of the text on the JButtons?

Thanks

-----------------------------------
HellblazerX
Sat May 23, 2009 11:44 am

RE:HOW to set font size and color for JButton?
-----------------------------------
You can use the JButtons.setFont (Font) method to set a new font.  However, I don't think you can change the color of the text.

-----------------------------------
Dark
Sat May 23, 2009 2:07 pm

RE:HOW to set font size and color for JButton?
-----------------------------------
what about


JButton lol = new JButton("ok");
lol.setForegroundColor(Color.red);

