This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to increase font of JLabel Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "how to increase font of JLabel" Watch "how to increase font of JLabel" New topic
Author

how to increase font of JLabel

sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
hey i know how to create JLabel but i dont know how to increase font in JLabel please help me by providing a method thank you very much
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

1) get the current Font using getFont.
2) get a copy with an increased size using Font.deriveFont.
3) set the Font using setFont.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
Rob Spoor wrote:1) get the current Font using getFont.
2) get a copy with an increased size using Font.deriveFont.
3) set the Font using setFont.


replied you sir and i post request too

n i didnt get these points can you provide some short code thanks for helping me out
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4165
    
    3

sagar khana wrote:n i didnt get these points

Did you read the API for the methods Rob mentioned? namely Component#getFont(), Font#deriveFont(...) and Component#setFont(...)

sagar khana wrote:can you provide some short code thanks for helping me out

Please read this section of How To Ask Questions On Java Ranch. Then try it yourself and ask a specific question if you don't get the desired result.


luck, db
There are no new questions, but there may be new answers.
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
Darryl Burke wrote:
sagar khana wrote:n i didnt get these points

Did you read the API for the methods Rob mentioned? namely Component#getFont(), Font#deriveFont(...) and Component#setFont(...)

sagar khana wrote:can you provide some short code thanks for helping me out

Please read this section of How To Ask Questions On Java Ranch. Then try it yourself and ask a specific question if you don't get the desired result.


ok
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to increase font of JLabel
 
Similar Threads
How can I increase the size of a Font?
change font in JPanel
Increasing font size in Eclipse
Uniform Font for class of swing components
Setting a JEditorPane to use JLabel's default font when using HTML