Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Graphics2D

 
pride Jimmy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I get the instance of Graphics2D?(exclude passed as parameters)
Thanks for any answer!
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java 2, the Graphics object passed to a Component's paint method is actually a Graphics2D instance. Cast it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic