Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Font size change for a text in Applet.

 
Thunthu Ganapathy
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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
 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Matt,
Yes. I have included into the init() method and it worked. Thanks a ton.
Thanks,
Thunthu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic