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 working with Fonts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "working with Fonts" Watch "working with Fonts" New topic
Author

working with Fonts

Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

Hello everyone.

My question of the day is regarding the font size in a JTable. (I think it should be pretty easy, but I dont know it). i want to be able to change the font size. I have found multiple sites which say to change the font size, I need to call table.setFont( new Font()) In the constructor I need to declare the font name, style, and size. Does Java have a list of default font styles that I can choose from, or must I provide my own font file so that i can declare a new font? Or is there some sort of method like new Font(getDefaultFont().setFontSize()) or something? If there is a list, where can I find it?

Thanks for your help.

Greg
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Greg Reeder wrote:is there some sort of method like new Font(getDefaultFont().setFontSize()) or something?

Have you gone through the methods available in the Font API?

Greg Reeder wrote:is there some sort of method like new Font(getDefaultFont().setFontSize()) or something? If there is a list, where can I find it?

http://download.oracle.com/javase/6/docs/api/java/awt/GraphicsEnvironment.html#getAllFonts()
Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

Thank you. it was not exactly what i was looking for, but it definately put me on the right track.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: working with Fonts
 
Similar Threads
Using CSS float for positioning page elements
Inheritance
Change the font in a JList
[AspectJ] Adding PropertyChangeEvents
Class definition