• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

working with Fonts

 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. it was not exactly what i was looking for, but it definately put me on the right track.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic