How can I completely make the gray panel transparent so that I can only see the Test button, but not the gray window (JPanel or JLayeredPane)
Screenshot: 
public class win extends JWindow { ... public win() { super(new JFrame()); layers = new JLayeredPane(); button = new JButton("close"); this.setLayout (new BorderLayout ()); .. button.setBackground(Color.RED); button.setSize(200,200); button.setLocation(0,20); this.add("North", button); JPanel p = new JPanel(); p.setOpaque(false); p.setSize(300, 200); p.setLocation(0, 0); p.add(new JButton("Test")); layers.add(p, new Integer(1)); layers.setSize(400,300); layers.setLocation(400,50); layers.setOpaque(false); this.add("North", layers); canvas.setSize(screenSize.width,screenSize.height); this.add("North",canvas);
Subsequent: installed as recommended, but so far failed.
ERROR not solved: Exception in thread "main" java.lang.UnsupportedOperationException: The TRANSLUCENT translucency kind is not supported. Installed: compiz-gnome.i686 0:0.9.4-2.fc15 Dependency Installed: compiz-gtk.i686 0:0.9.4-2.fc15 compiz-plugins-main.i686 0:0.9.4-1.fc15 libcompizconfig.i686 0:0.9.4-1.fc15 protobuf.i686 0:2.3.0-7.fc15 Complete! You have mail in /var/spool/mail/root [ root@example ~]
source share