How to draw graphics in java?
  • There is double data type: x = 1, x = 2 ... and y = 0.000111, y = 0.002133 ... - Burunduk
  • Will the method: drawPolyline (xPoints, yPoints, nPoints) from the Graphics class work? - Burunduk

3 answers 3

A couple of weeks ago I ran into this problem myself, this library came to hand.

I was pleased to deal with it for long, because many examples are right there on the site + documentation, but this is if you decide to deeply understand.

  • alex91, thanks! I'm going to try now. - Burunduk

It’s not completely clear what to draw ... If you have simple shapes, use Java 2D Graphics. And if you specifically draw different graphics, then there is a great lib JFreeChart .

    An example of a program for outputting graphics of mathematical functions, the principle is simple - one point is calculated, and the second follows it one step back. Java lines are drawn between these points. Function graphs