how to make jframe with background image transparent

ifi use GlassPane the components are made invisible .plz help me Urgent
[78 byte] By [susrapa] at [2007-11-27 1:22:48]
# 1
is it so hard to post a sample program:a JFrame with a JLabel and your glasspane, so we can see what you've done
Michael_Dunna at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...
# 2

import javax.swing.*;

import java.io.*;

import java.util.*;

import java.awt.*;

import java.io.File.*;

import java.awt.event.*;

public class chatscrlldemo extends JFrame implements ActionListener

{

JFrame jf;

JPanel jp , jp1;

JRootPane jrp;

JLayeredPane jlp;

ImageIcon icon;

String sr;

JButton jb;

JTextField jtf;

JScrollPane jsp;

JTextPane jtp;

chatscrlldemo()

{

Dimension d =new Dimension(805 , 100);

jf = new JFrame();

jp = new JPanel();

jp1 = new JPanel();

icon = new ImageIcon("11.swf");

setSize(800 , 600);

setDefaultCloseOperation(3);

jp1.setBounds(50 ,50 , 400 , 200);

jp1.setBackground(Color.pink);

jp1.setVisible(true);

jp.setBounds( 0 , 300 , 800 ,400);

jp.setBackground(Color.blue);

jp.setVisible(true);

jrp = jf.getRootPane();

jb = new JButton("send");

jtf = new JTextField(10);

jtp = new JTextPane();

jtp.setPreferredSize(d);

jtp.setBackground(Color.red);

jtp.setVisible(true);

jsp = new JScrollPane(jtp );

jsp.setSize(300 , 300);

jsp.setBackground(Color.cyan);

jsp.setVisible(true);

jp.add(jb);

jp.add(jtf);

jp.add(jsp);

jlp = jrp.getLayeredPane();

jlp.add(jp);

jlp.add(jp1);

jlp.setLayer(jp ,1);

jlp.setLayer(jp1 ,1);

jb.addActionListener(this);

setVisible(true);

jrp .setGlassPane(jsp);

getContentPane().add(jlp);

}

public void actionPerformed(ActionEvent ae)

{

String str = ae.getActionCommand();

if(str.equals("send"))

sr = jtf.getText();

jtf.setText(" ");

}

public static void main(String s[])

{

new chatscrlldemo();

}

public void paint(Graphics g)

{

File f = new File("images\backgroundimage.png");

Image img = ImageIO.read(f);

if(img!=null)

g.drawImage(img , 0 , 0 , getWidth() ,getHeight());

}

}

susrapa at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...
# 3
plz reply urgent
susrapa at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...
# 4
run your program, then drag one of the borders to make the frame wider or talleranything appear now?
Michael_Dunna at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...
# 5

Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.

Don't override the paint() method of a JFrame.

Custom painting is done in the paintComponent() method of a component that extend JComponent.

camickra at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...
# 6
i did it but it is not working
susrapa at 2007-7-12 0:10:26 > top of Java-index,Desktop,Core GUI APIs...