Draw a line by clicking and dragging on the pixel grid shown with the left mouse 
  button. An ideal line is displayed until the left button is released. Upon release 
  a discrete approximation of the line is drawn on the display grid using the 
  lineBresenham() method described in the previous slide. An ideal line is then 
  overlaid for comparison.
  The lineBresenham() method: