Drawing a point
I have written a code that gives me the position of a planet in relation to the sun.
What i get is the position x and the position y.
now I would like to draw these positions in a window. The window I made is from the Graphics class.
I am searching a method (like drawLine) but for points.
Thanks in advance.
g2.fill(new Ellipse2D.Double(p.x-1.5, p.y-1.5, 4, 4));
An ellipse is a good choice if you wish to give the planets some "volume" to be seen better.
There does not seem to be a specific method to draw points. But you can use drawLine and make the two points in between which it would draw the line the same.
g.drawLine(p.x, p.y, p.x, p.y);
thanks to both of you.
I got it sorted out with dans method!