File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 19649

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

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.
I agree. Here's the link:
subject: graphics fillRect and getColor
Similar Threads
swing display issue on Laptops
SwingUtilities2 is deprecated.. any alternative
WA #1.....word association
suggest a concept for workshop