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

FontMetrics

 
kumar mars
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
are the changes in the font automatically get reflected in the FontMetrics object or should get the instance again

in the paint mathod i am displaying multilingual text and using FontMetrics object to get the properties of the text like width.
whenever there is a change in font i am indicating it as g.setFont()
should i use g.getFontMetrics() method to update the FontMetrics object or will be automaticatically updated
expecting an early reply
bye
 
george justin
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kumar
I think FontMetrics Object gets updates automatically for that particular component, u can get the instance of FontMetrics from
Font f = new Font("","","");
getFontMetrics(f); at any point of time
method of the component class, no need to get instance from the graphics class
Cheers
George Justin

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic