File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 4664
    
    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: 4664
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you guys define one font style for all application?