• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set font in JFileChooser?

 
Trung Nguyen Tuan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone please tell me how to set font in JFileChooser???
I've tried setFont method on JFileChooser class but it made no difference.
Thanks in advance
[ January 02, 2006: Message edited by: Trung Nguyen Tuan ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because of the various components in a JFileChooser,
you may have to do it with 'brute force'

something like this

 
Trung Nguyen Tuan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent! Thankyou so much David.
 
Robert Thompson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent code snippet! I tried to set the dialog font with setFont, but I guess it only sets the caption font. You have to recursively set all of the sub-component fonts.

BTW, this is a good general purpose function for setting any dialog font. For example, it can be used to set the main frame's fonts so you don't have to individually set the fonts for all of the controls you drop down (a real pain!).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!