aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Font Chooser JComboBox (RESOLVED) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Font Chooser JComboBox (RESOLVED)" Watch "Font Chooser JComboBox (RESOLVED)" New topic
Author

Font Chooser JComboBox (RESOLVED)

Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Hi all,

Still not 100% certain about what makes a beginner/intermediate/advanced query, so apologies if this is in the wrong place!

Anyway, to the point - I'm trying to make a Word-style drop-down font selection list. I'm guessing that the best option is a JComboBox populated with all the fonts in my system - so the question that I'm asking is: is there a way to get a list of all my fonts?

Any other advice much appreciated!
[ February 20, 2006: Message edited by: David Payne ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18155
    
    8

I knew there must be one, because I wrote one myself. But I wrote it a couple of years ago (so I don't remember what I did) and it's on my home computer. So I quickly checked the documentation for java.awt.Font and after scrolling down a bit I came upon this sentence:

"The getAllFonts method of the GraphicsEnvironment class returns an array of all font faces available in the system."

It goes on to explain what to do with that list, but in any case that's your starting point.
Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Splendid, couldn't have hoped for a better answer!

Thanks very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Font Chooser JComboBox (RESOLVED)
 
Similar Threads
Changing Font Size on a Chart
Puzzle in getting OS's FONT_SIZE
Windows XP and Fonts
Changing Font
smoothing fonts