• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing Text Color

 
james wilson
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe i'm being a bit slow, but is there anyway of changing the text colour of components. And in the case of buttons changing the background colour, or even using a image as the button.
Thanks in advance
James Wilson
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All components (including Buttons) inherit the setForeground(Color c) and setBackgroung(Color c) methods from Component.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a thread that describes putting an image on a Button.
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setForeground( Color.blue )
setBackground( Color.white )
Check out Sun's JButton tutorial

------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author Mike Meyers' Java 2 Certification Passport
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic