Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HOW to set font size and color for JButton?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rated




PostPosted: Fri May 22, 2009 7:48 pm   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: Sat May 23, 2009 11:44 am   Post subject: 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




PostPosted: Sat May 23, 2009 2:07 pm   Post subject: RE:HOW to set font size and color for JButton?

what about

Java:

JButton lol = new JButton("ok");
lol.setForegroundColor(Color.red);
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: