This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 19538

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: 4522

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: graphics fillRect and getColor
Similar Threads
swing display issue on Laptops
suggest a concept for workshop
SwingUtilities2 is deprecated.. any alternative
WA #1.....word association