Click to See Complete Forum and Search --> : drawing graph using java


Imin
12-09-2003, 08:26 AM
hi

how do we create graph in java?

thanx a lot
bye

Stuka
12-09-2003, 10:53 AM
I think you want the Java 2D graphics libraries - there should be plenty of info on java.sun.com regarding them.

voidinit
12-09-2003, 01:31 PM
Originally posted by Imin
hi

how do we create graph in java?

thanx a lot
bye

The easiest way would be to use the plain ol' boring java.awt.* windowing toolkit.

It should be pretty usy to dump your source data into two arrays, say x[] and y[], then use the java.awt.Graphics.drawLine(x[1], y[1], x[2], y[2]) method in your paint() implementation. Just throw that into an iterating loop so that your next drawline() call get's the parameters x[2], y[2], x[3], y[3].