title: How to create a transparent JPanel
body: <p>I am trying to make my JPanel transparent but i just can not achive that . I have tried this code, but it doesn't work. Also, what are the bound of the 'a' from rgba ?</p>
  
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  import java.io.IOException;
  
  import javax.swing.*;
  import javax.swing.plaf.LayerUI;
  
  
  public class Animation extends JPanel implements Runnable
      JButton buton = new JButton("BUTTON!!!! ");
  
  
      public Animation(){
          add(buton);
  
      }
          public void paintComponent(Graphics g) {
              g.setColor(getBackground());
              Rectangle r = g.getClipBounds();
              g.fillRect(r.x, r.y, r.width, r.height);
              super.paintComponent(g);
  
      }
  
  
      public static void main(String[] args) {
          JFrame frame = new JFrame();
          JPanel panel = new Animation();
          panel.setOpaque(false);
          panel.setBackground(new Color(52, 152, 219,0));
          panel.repaint();
          frame.add(panel);
          frame.setVisible(true);
          frame.setSize(1000,400);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          ;
  </code></pre>