203.129.225.221 writes:
I want to know how getGraphics() function works
How the compiler allows the component class to create an instance of an abstract class Graphics
Please let me know this.I do not want to know how to create the instance of the Graphics class through function calls
Thanks
Anand
Anand Gore
24.1.16.214 writes:
here's what my intro Java textbook says about this question:
The Graphics class is somewhat special in that the programmer does not instantiate it. Because the details fo drawing graphics are unique for each type of computer system, the Graphics class is device dependant. The Graphics object corresponding to a particular surface is obtained either by using the getGraphics method of the surface, or by accepting it as a parameter to a method that is invoked automatically, such as paint
. hope that helps...
-calyxa