Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do change the font size and font color from a Java file?

How can I change the font color, size and button color from a Java file in Eclipse, not from an XML file?

like image 345
sheraz amin Avatar asked Aug 23 '11 06:08

sheraz amin


1 Answers

For font size you can write it as

tv.setTextSize(20.0f);

For font color you can write it as

tv.setTextColor(Color.BLUE);

For button background color you can write it as

btn.setBackgroundColor(Color.CYAN);
like image 144
Lavanya Avatar answered Oct 05 '22 09:10

Lavanya