The Graphics class provides methods for rendering the following:
Rectangles, arcs, ovals, and polygons can also be filled. In this section, we will explore all but the last item listed above—for information on displaying and filtering images, the Loading and Displaying Images chapter and the Image Filtering chapter.
Lines are drawn by use of invoking Graphics.drawLine(int x, int y, int x2, int y2). The AWT is not capable of drawing lines of variable thickness; the graphics's pen, and therefore the lines it draws, are always one pixel thick. In addition, lines are always drawn solid—there is no provision for patterned lines such as dotted or dashed. ...