describe graphics objects in java all drawing


Describe Graphics Objects ?

In Java all drawing takes place via a Graphics object. This is an example of the class java.awt.Graphics.

Initially the Graphics object you use will be the one passed as an argument to an applet's paint() method. Later you'll see other Graphics objects too. Everything you learn presently about drawing in an applet transfers directly to drawing in other objects such as Panels, Buttons, Frames, Canvases and more.

Each Graphics object has its own coordinate system, and all the techniques of Graphics involves those for drawing Strings, lines, rectangles, circles, polygons and more. Drawing in Java begins with particular Graphics object. You get access to the Graphics object through the paint(Graphics g) method of your applet. Each draw method call will look like g.drawString("Hello World", 0, 50) where g is the particular Graphics object with that you're drawing.

For convenience's sake in this lecture the variable g will always refer to a preexisting object of the Graphics class. As with any other method you are free to use a few other name for the particular Graphics context, myGraphics or appletGraphics perhaps.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: describe graphics objects in java all drawing
Reference No:- TGS0285139

Expected delivery within 24 Hours