• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Font size change for a text in Applet.

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to change the font size of a text that I am passing from HTML to an applet.
Here is how I am setting the background and foreground colors.
public void init() {
setBackground(Color.gray);
setForeground(Color.black);
//setFontsize(10);//Is there any object that I make use of?
}
Similarly I want to control the font size also. Examples would be great.
Could any one throw some light on this.
Thanks,
Thunthu
 
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can do something like this:
import java.awt.Font;
Font myFont = new Font("TimesRoman", Font.BOLD, 18);
// set the component or graphics object like this:
someComponent.setFont(myFont);

Does this help?
Best Regards,
Matt

[This message has been edited by Matt Midcap (edited June 22, 2000).]
 
Thunthu Ganapathy
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,
Yes. I have included into the init() method and it worked. Thanks a ton.
Thanks,
Thunthu.
 
Oh the stink of it! Smell my tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic