Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

Font class problem

Thread view: 
Rene Ruppert - 09 Dec 2003 12:08 GMT
Hi,

I use this piece of code to replace the font in a table header:

UIDefaults def = UIManager.getDefaults();
myDefaultFont = (Font)def.get("TableHeader.font");
myDefaultFont = new Font("Verdana", defaultFont.getStyle(), 11);

Is there a way to check out if the font "Verdana" really exists?
Background: if I use this and the font doesn't exist the Font class will
fall back on a default font, but in that case I would like to try "Arial"
first, then "Helvetica" and if all of these fonts don't work I want Java to
use the standard font.

Thanks.

cu

Rene
Thomas Weidenfeller - 09 Dec 2003 13:30 GMT
> Is there a way to check out if the font "Verdana" really exists?

GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()

/Thomas
Rene Ruppert - 10 Dec 2003 13:11 GMT


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.