aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes graphics fillRect and getColor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "graphics fillRect and getColor" Watch "graphics fillRect and getColor" New topic
Author

graphics fillRect and getColor

prashant sushant
Greenhorn

Joined: Jul 24, 2011
Posts: 1
the fill Rect,setColor etc are all abstarct methods.....so how can we direclty use them with a graphics opject....
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

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


luck, db
There are no new questions, but there may be new answers.
 
wood burning stoves
 
subject: graphics fillRect and getColor