java - How do I plot 2 points in a graph in a GUI? -


i trying make gui plot 2 points in line graph , draw line segment 2 points.

i cannot find examples in of java textbooks, , every example try search complex understand in short amount of time have.

is there anyway explain graphing beginner in java?

use canvas drawing surface.

use drawline() function draw line between x1,y1 , x2,y2.

there lots of samples out there this, such as: http://mainline.brynmawr.edu/courses/cs110/fall2003/applets/canvasexample/canvasexample.html

or this: http://www.java2s.com/code/java/2d-graphics-gui/drawcanvaswithcolorandtext.htm

laurence


Comments