title: How to make java.awt.Label background transparent?
body: <p>I used to do the transparent background with javax.swing.JLabel this way: </p>
  
  <p><code>lbl.setBackground(new Color(0, 0, 0, 0));</code>. </p>
  
  <p>But it doesn't work with java.awt.Label. Is there any simple way to make the label transparent?</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>public class SplashBackground extends Panel {
  
      private static final long serialVersionUID = 1L;
  
      private Image image = null;
  
      /**
       * This is the default constructor
       */
      public SplashBackground() {
          super();
          initialize();
      }
  
      /**
       * This method initializes this
       * 
       */
      private void initialize() {
          image = Toolkit.getDefaultToolkit().createImage(getClass().getResource("/splash/splash.jpg"));
          this.setLayout(null);
      }
  
      @Override
      public void paint(Graphics g) {
          super.paint(g);
          if(image != null) {
              g.drawImage(image, 0,0,this.getWidth(),this.getHeight(),this);
          }
      }
  
  }
  </code></pre>
  
  <p>and    </p>
  
  <pre><code>lbl= new Label();
  lbl.setBackground(new Color(0, 0, 0, 0));
  splashBackground = new SplashBackground();
  splashBackground.add(appNameLabel, null);
  </code></pre>