• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setFont() question

 
Mike Brown
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am studying Java and am stuck with a newbie problem. I need to display my name in every font size from 4 to 24 in a swing applet. I can set up the loop no problem. I was thinking that I will need to somehow pass the counter from the loop as an argument to the setfont() method? That would be my font size increasing? I need to have three arguments for defining the new font.The font size being the last one. I know that much. What is the best way to do this? Am I totaly going about this the wrong way?Oh well I hope I explained it properly. Please help if you can. Thank you all for your time.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Phil!
I'm moving this to the Swing / JFC / AWT forum...
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use deriveFont(newSize) on Font to create new Font with specified size.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic