FileDocCategorySizeDatePackage
BGTest2.javaAPI DocExample852Mon Jan 09 11:01:58 GMT 2006None

BGTest2

public class BGTest2 extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        JFrame frame = new JFrame("Transparent Window");
        frame.setUndecorated(true);
        TransparentBackground bg = new TransparentBackground(frame);
        bg.setLayout(new BorderLayout());
        
        JPanel panel = new JPanel() {
            public void paintComponent(Graphics g) {
                g.setColor(Color.blue);
                Image img = new ImageIcon("mp3.png").getImage();
                g.drawImage(img,0,0,null);
            }
        };
        panel.setOpaque(false);
        
        bg.add("Center",panel);
        
        
        frame.getContentPane().add("Center",bg);
        frame.pack();
        frame.setSize(200,200);
        frame.setLocation(500,500);
        frame.show();