aspose file tools*
The moose likes Applets and the fly likes Font size change for a text in Applet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Font size change for a text in Applet." Watch "Font size change for a text in Applet." New topic
Author

Font size change for a text in Applet.

Thunthu Ganapathy
Greenhorn

Joined: May 09, 2000
Posts: 19
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

Joined: Jan 07, 1999
Posts: 440
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).]


Best Regards,<br />Matt Midcap
Thunthu Ganapathy
Greenhorn

Joined: May 09, 2000
Posts: 19
Matt,
Yes. I have included into the init() method and it worked. Thanks a ton.
Thanks,
Thunthu.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Font size change for a text in Applet.