• Post Reply Bookmark Topic Watch Topic
  • New Topic

External Font usage

 
Phil Pe
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to have my title in an applet to be in a specified font (in this case Pokemon.ttf - TrueType font), but the following lines just makes the title in a standard font, can anyone tell me what I'm doing wrong? (the font file .ttf is in the same directory as the .java program. I also tried putting the font in lib/fonts in java compiler directory but no results)
JLabel label = new JLabel("Title");
Font myTitleFont = new Font("Pokemon", Font.BOLD | Font.ITALIC, 32);
label.setFont(myTitleFont);
Thnak you very much for you help!
 
allen turner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a font depends on the OS u are using> In windows u need to install the font from the control panel. then u should not have problems in accessing that font.
 
Phil Pe
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, it worked great! I din't think of that at all
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!