This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How do you guys define one font style for all application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do you guys define one font style for all application?" Watch "How do you guys define one font style for all application?" New topic
Author

How do you guys define one font style for all application?

Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
Hello guys

I know how to use setFont and Font class to change the font of compnent some thing like :


but the question is I want to write this code only once and it I want it to change the entire applications font. Is it possbile ?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4531
    
    5

If this is Swing, you can use the methods of UIManager. For the keys, check out Rob Camick's UIManager Defaults.


luck, db
There are no new questions, but there may be new answers.
Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
Darryl Burke

Thank you very much, I got it solved

there is my code, in case some one needs



Good Luck
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4531
    
    5

Farhad, thanks for sharing your solution. You could also use UIManager.getFont(key) which returns null if the value for key is not a Font.
Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
Darryl Burke wrote:Farhad, thanks for sharing your solution. You could also use UIManager.getFont(key) which returns null if the value for key is not a Font.


oh Yea thank you very much for you idea.
 
 
subject: How do you guys define one font style for all application?