title: How to draw a circle with given X and Y coordinates as the middle spot of the circle?
body: <p>I have developed a telecommunication application for locating signal strengths from the towers. I have used java swing and I'm having a problem when drawing the circle around the given point of the mobile signal transmitter tower location. I have already calculated the X, Y coordinates and also the radius value. </p>
  
  <p>Please find the below code which I've used to draw the circle and it is having issues.</p>
  
  <pre><code>JPanel panelBgImg = new JPanel() {
      public void paintComponent(Graphics g) {
          g.drawOval(X, Y, r, r);
      }
  }
  </code></pre>
  
  <p>The issue is, it creates the circle but it didn't take the X and Y coordinates as the center point. It took the X and Y coordinates as the top left point of the circle. </p>
  
  <p>Could anyone please help me to draw the circle by having the given X and Y coordinates as the center point of the circle.</p>