title: Transparency in bufferedimage objects
body: <p>I noted that when i draw something with Color(0,0,0,0), which is over another image, the color shown is the JFrame background, not the image just below it.</p>
  
  <p>Reasons that'd help me to find a solution?</p>
  
  <p>Thanks!!</p>
  
  <p>Edit: See the circles, the grey area (corners) should be transparent but are not, instead, they are the color of the JFrame.
  <a href="http://img72.imageshack.us/img72/9657/transparency.png" rel="nofollow noreferrer">alt text http://img72.imageshack.us/img72/9657/transparency.png</a></p>
  
  <p>And here is the code to draw the circles:</p>
  
  <pre>
  public void paint(final Graphics g) {
          super.paintComponent(g);
          final Graphics2D g2 = (Graphics2D) g;
  
          RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  
          if (unitImage == null) {
  
              unitImage = (BufferedImage) (createImage(30, 30));
              final Graphics2D gc = unitImage.createGraphics();
              gc.setRenderingHints(rh);
              gc.setColor(outsideColor);
              gc.fillOval(0, 0, diameter, diameter);
              gc.setColor(middleColor);
              gc.fillOval(diameter / 6, diameter / 6, (diameter / 3) * 2, (diameter / 3) * 2);
              gc.setColor(innerColor);
              gc.fillOval(diameter / 3, diameter / 3, diameter / 3, diameter / 3);
          }
  
          g2.drawImage(unitImage, null, 0, 0);
  </pre>
  
  <p>Been toying with the Alphacomposites, i think its not the solution. So i added all this new info which i believe, will help you guys to give me another tip.</p>