How do I iterate through the points on a straight line?
<p>Is there a way to iterate through all the points on a line in java 2D?</p>

<p>I've looked through the class documentation and can't see anything that does it built in. If not, would it be better to extend the class and write my own method which calculates the equation of the line and then goes through each point? (Would this actually work as the theoretical equation of a line and the pixels that it actually draws in seem to be slightly different)</p>
