-1

Is threre a way to draw "perfect" circle in java. What I mean is that when I use drawOval()(I don't want a filled oval)and make it thiker it shows something like this: Image1 but I want it like this: Image2

Is there a java method who can do the job and if there is, who is it and how to use it? EDIT: I found answer on another question in Stack Overflow. The link of that question is in the comments!

Community
  • 1
  • 1
FreakyOne
  • 351
  • 1
  • 3
  • 12
  • 1
    I would suggest having a look at [the 2D Graphics trail](https://docs.oracle.com/javase/tutorial/2d/overview/index.html) - one of the things you're going to want to look at is `Stroke` – MadProgrammer Jul 01 '17 at 09:19
  • 1
    I'd like to see the code which creates the first image – MadProgrammer Jul 01 '17 at 09:21
  • How is the space defined where you draw that circle? Is it drawn on a box with a limited size? That would explain why it looks odd. – Garamaru Jul 01 '17 at 12:35
  • Sorry guys I found that what I was searchng for on https://stackoverflow.com/questions/16995308/can-you-increase-line-thickness-when-using-java-graphics-for-an-applet-i-dont Thanks for your help! – FreakyOne Jul 01 '17 at 13:55

1 Answers1

0
 g.drawOval(25, 35, 25, 35);
 g.drawOval(25, 35, 25, 25); → circle
 drawOval(int x, int y, int width, int length)

Used to draw an oval inside an imaginary rectangle whose upper left corner is at (x,y). To draw a circle keep the width and length the same

moh89
  • 133
  • 1
  • 2
  • 12
  • I know that if I want to make a circle, I must use draw/fillOval with the same width and height, but when I make the circle thiker it is like the circle on the first image. This answer didn't help me! – FreakyOne Jul 01 '17 at 12:04