Java Graphics class


java.awt.Graphics comes with many methods of drawing different geometrical figures. The Graphics object is passed as parameter to paint() method.

Following programs use Frame or Applet window to draw figures.

A. Basic Programs

1. Graphics – Introduction

B. For the usage of methods of Graphics class

1. For darwLine(): Drawing Lines
2. For drawString(): Drawing Strings
3. For drawRect(): Drawing Right-angled Rectangles
4. For drawRoundRect(): Drawing Round Cornered Rectangles
5. For draw3DRect(): Drawing 3-D Rectangles
6. For drawOval(): Drawing Ovals
7. For drawArc(): Drawing Arcs
8. For drawPolygon(): Drawing Polygons (Graphics in Applets)
9. For drawImage(): Drawing Images
10. No draw Circle(): Drawing Circles (Graphics with Applets)

11. Special Figures: Drawing Cylinder, Cube, Circle

C. Graphics indepth

1. All Geometrical Figures at a glance

Leave a Comment

Your email address will not be published.