aspose file tools*
The moose likes Beginning Java and the fly likes Changing Text Color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Changing Text Color" Watch "Changing Text Color" New topic
Author

Changing Text Color

james wilson
Greenhorn

Joined: Nov 17, 2001
Posts: 15
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

Joined: Sep 29, 2000
Posts: 8521
All components (including Buttons) inherit the setForeground(Color c) and setBackgroung(Color c) methods from Component.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Here is a thread that describes putting an image on a Button.
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
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


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Changing Text Color