This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "graphics fillRect and getColor" Watch "graphics fillRect and getColor" New topic

graphics fillRect and getColor

prashant sushant

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

Joined: Oct 27, 2005
Posts: 19725

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.

How To Ask Questions How To Answer Questions
Darryl Burke

Joined: May 03, 2008
Posts: 4642

prashant, we don't have too many rules around here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites.

edit And

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