title: How to make a transparent JFrame but keep everything else the same?
body: <p>I want to make the <code>JFrame</code> transparent, but the image on top of it to be non-transparent. This is what I have now: </p>
  
  <p><img src="https://i.stack.imgur.com/V9In2.jpg" alt="enter image description here"></p>
  
  <p>Does anyone know a way to make only the <code>JFrame</code> transparent?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import com.sun.awt.AWTUtilities;
  import static java.awt.GraphicsDevice.WindowTranslucency.*;
  
  public class SplashDemo extends JFrame
  {
      public SplashDemo()
      {
          setUndecorated(true);
          setSize(200, 200);
  
          add(new JLabel(new ImageIcon("puppy2.png"))); 
          setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          setVisible(true);
  
          setOpacity(0.85f);      
      }
  
       public static void main(String[] args) 
       {
          new SplashDemo();
       }
  }
  </code></pre>