This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How To Change Label Text Size?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How To Change Label Text Size??" Watch "How To Change Label Text Size??" New topic
Author

How To Change Label Text Size??

may tan
Greenhorn

Joined: Jul 22, 2005
Posts: 22
HellOoo..

Is there a way to increase the text size on a label?
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
You can create a Font object with the font face and size that you need, then you can apply the font to the label using myLabel.setFont(myFont);

Cheers,
Rachel
may tan
Greenhorn

Joined: Jul 22, 2005
Posts: 22
oh ok.. but wad is the coding if i want to increase the size of e texts in the label??

and how i know what are e varoius size available in java??
like for example in html.. e size range frm 1 - 7.
so wad abt java??
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> but wad is the coding if i want to increase the size of e texts in the label??

look at the api docs for Font, and you'll find this constructor
public Font(String name,int style,int size)

and you would write it something like this
label.setFont(new Font("Lucida",Font.PLAIN,24)); //24 = size
may tan
Greenhorn

Joined: Jul 22, 2005
Posts: 22
thanks.. i got it..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Change Label Text Size??
 
Similar Threads
align JLabel to left
Managing the Firefox scrollbar with divs
font j label
change font size
dynamic size of label