Can i get the codes for Bresenham Line Algorithtm. I have searched for it on google and i get the codes but they do not attach the codes to call the class, and also the codes do not allow user input.
Am now learning java so adding comments would help me a lot.

... i get the codes but they do not attach the codes to call the class, and also the codes do not allow user input...

That's normal. The code for the algorithm will be similar no matter how you use it, but how you get the input values etc will be completely different from one application to the next.
Your sample code will probably have a method that starts a bit like like this:
public void line(int x,int y,int x2, int y2, int color)
so you need to pass (in this example) four ints for the starting and ending points, and a fifth value for the color of the line.
How you get those values from the user is up to you. Eg: you could create Window with 4 or 5 input fields, or use Java's built-in GUI dialogs, or you could use the system console with a Scanner to prompt the user and parse his replies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.