File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getGraphics

 
kumar mars
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
what happens i mean what all the methods invoked when
the methods getGraphics or getFontMetrics are invoked
is it good to use this methods either with in or from out side the paint method
i have to display a text which comprised of differrent fonts
so ihave to change the font and get the instances of graphics and fontMetrics updated how can i do this
hoping a better reply
 
Kris Philippaerts
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
you realy should try to keep your graphical work inside the paint or the paintComponent method. If not, you might lose graphical data when the component repaints.
You should use the Graphics object, given as a parameter in the paint or paintComponent method and use the setFont(..) method in Graphics to change your font.
HTH,
Kris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic