GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Change color of a LookAndFeel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change color of a LookAndFeel" Watch "Change color of a LookAndFeel" New topic
Author

Change color of a LookAndFeel

Laurent Sate
Greenhorn

Joined: Dec 18, 2001
Posts: 10
Hello,
I want to change the color of all the text in my frame. For example, i want to have my JLabel in green in place of blue.
How can I do that?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

setForground(Color) will change the text color. setBackgroud(Color) will change the background color.
------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Laurent Sate
Greenhorn

Joined: Dec 18, 2001
Posts: 10
Yes but for the all
i have the response:
set foregroundcolor of all of them to what ever color you want!
use
UIManager.put("Label.foreground",Color.blue);
for other components also, do the same thing.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

LS,

Please re-register with a name that follows the Official JavaRanch Username Conventions. Your username needs to be in the format "first name" + space + "last name".

Thanks,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Michael Szul
Ranch Hand

Joined: Sep 18, 2001
Posts: 57
If you use themes with the Metal L&F you can change just about anything you want. Even globally.
 
GeeCON Prague 2014
 
subject: Change color of a LookAndFeel