I need to draw a line from point A(x1,y1) to point B(x2, y2). But instead of just show the line, I need to see the line was actually drawn - little bit by little bit, at a controllable speed - from point A to point B .
Thanks for any inputs.
Printable View
I need to draw a line from point A(x1,y1) to point B(x2, y2). But instead of just show the line, I need to see the line was actually drawn - little bit by little bit, at a controllable speed - from point A to point B .
Thanks for any inputs.
I would use Swing, draw in a JPanel's paintComponent method, have class fields x1, y1, x2, y2, and in a Swing Timer change x2 and y2 incrementally and then call repaint on the JPanel. If I weren't familiar with these terms, I'd study up on them in the Oracle Swing and Graphics tutorials. YMMV.