title: Drawing a circle on a bufferedImage in Java
body: <p>I want to draw a circle on a buffered image that act like a png</p>
  
  <p>i want to use this circle in order to replace the mouse cursor for a paint application i am working on.</p>
  
  <p>i cant download a circle png from google as i need to keep changing the size of this circle depending on the width of the tool i am using it for.</p>
  
  <p>here is my attempt so far </p>
  
  <pre><code>  public static BufferedImage getCircle() {
  
      BufferedImage bufferedImage = new BufferedImage(30, 30, BufferedImage.TYPE_INT_RGB);
      Color transparent = new Color(0x00FFFFFF, true);
  
      Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
      //trying to make the bufferedImage transparent 
      g.setComposite(AlphaComposite.Src);
      g.setColor(transparent);
      g.setBackground(transparent);
      g.fillRect(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight());
      //drawing the circle 
      g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      g.setColor(Color.black);
      g.drawOval(0, 0, 200, 200);
      return bufferedImage;
  }
  </code></pre>
  
  <p>it should look like: </p>
  
  <p><a href="https://i.stack.imgur.com/w1AyU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w1AyU.png" alt="enter image description here"></a></p>
  
  <p>However my code currently only creates a <strong>white square</strong>.</p>