• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

graphics fillRect and getColor

 
prashant sushant
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the fill Rect,setColor etc are all abstarct methods.....so how can we direclty use them with a graphics opject....
 
Rob Spoor
Sheriff
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

The Graphics object that is passed to the paint methods is an instance of some unknown sub class of Graphics. Usually it's also an instance of an unknown subclass of Graphics2D. That's all you need to know; you can use the methods defined in Graphics (and Graphics2D after casting) without having to worry about how and where they are implemented.
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prashant, we don't have too many rules around here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites.

http://www.java-forums.org/awt-swing/46836-graphics-fillrect-getcolor.html

edit And http://www.javaprogrammingforums.com/awt-java-swing/10055-graphics-fillrect-getcolor.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic