Home Segments Top Top Previous Next

1116: Mainline

To draw a line using the Graphics2D graphics context, you first construct a path, an instance of the GeneralPath class, such as path in the following illustration:

GeneralPath path = new GeneralPath();