How to draw a decent looking Circle in Java

前端 未结 7 1438
我在风中等你
我在风中等你 2020-11-27 06:20

I have tried using the method drawOval with equal height and width but as the diameter increases the circle becomes worse looking. What can I do to have a decent looking cir

7条回答
  •  面向向阳花
    2020-11-27 06:47

    you can set rendering hints:

    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
    

提交回复
热议问题