Results 1 to 3 of 3
Thread: Graphics abstract class
- 06-05-2012, 09:03 AM #1
Member
- Join Date
- May 2012
- Posts
- 10
- Rep Power
- 0
Graphics abstract class
hi,
I know that the Graphics class is an abstract class.
For that reason, normally, we can not create an instace of this class.
Why can i code this
Where the g variable has to receive the adress of an instance of the Graphics class.Java Code:public void paint(Graphics g) { ..... }
Thanks a lot for explaining it to me.
Regards.
curious_programmer
- 06-05-2012, 12:22 PM #2
Re: Graphics abstract class
You don't call painting methods directly. You call repaint() and the GUI toolkit supplies an appropriate concrete subclass of Graphics (actually, for more than 10 years, a subclass of Graphics2D).
Read more about it in the Tutorial Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
In future, AWT/Swing questions should be posted in the AWT/Swing section. If your question is more about Java 2D, there's a section for that too.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 06-05-2012, 12:23 PM #3
Similar Threads
-
abstract method-abstract class
By durgaprasad1407 in forum New To JavaReplies: 1Last Post: 04-29-2011, 06:58 PM -
Class is not abstract and does not override abstract method run(com.
By rgeurts in forum New To JavaReplies: 4Last Post: 04-14-2011, 11:42 AM -
How can I call abstract class methods from another class
By srinivas2828 in forum New To JavaReplies: 13Last Post: 03-12-2010, 02:33 PM -
Difference between Abstract class having only abstract method and a Interface class
By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 10:51 AM -
what is the Priority for execution of Interface class and a Abstract class
By Santoshbk in forum Advanced JavaReplies: 0Last Post: 04-02-2008, 07:04 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks