Home Segments Top Top Previous Next

719: Mainline

Should you want to draw a simple line, at position (0, 50), with width equal to 100, you use the graphics context as the target of the drawLine method:

*-- Graphics context 
| 
|          *-- x coordinate of one end 
|          |   *-- y coordinate of that end 
v          v   v 
g.drawLine(0, 50, 100, 50);  
                   ^    ^ 
                   |    *-- y coordinate of that other end 
                   *-- x coordinate of the other end