jframe添加背景图片问题
package com.instantcommunication.gui;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class Login extends JFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel l_jp=null;
private JLabel l_nameLabel=null,l_passLabel=null,l_image=null;
private JTextField l_jtf=null;
private JPasswordField l_jpf=null;
private JButton l_jb=null;
private ImageIcon icon=new ImageIcon("a.jpg");
Container con=this.getLayeredPane();
Container con2=this.getContentPane();
public Login(){
setTitle("登录");
l_jp=new JPanel(null);
l_nameLabel=new JLabel("用户名");
l_passLabel=new JLabel("密 码");
l_image=new JLabel(icon);
l_jtf=new JTextField(10);
l_jpf=new JPasswordField(10);
l_jb=new JButton("登录");
this.setBounds(200, 200, 380, 280);
l_nameLabel.setBounds(70,60,50,30);
l_passLabel.setBounds(70,110,50,30);
l_jtf.setBounds(120, 60, 180, 30);
l_jpf.setBounds(120, 110, 180, 30);
l_jb.setBounds(150,170,80,30);
l_image.setBounds(0, 0, 380, 280);
con.add(l_image);
con2.add(l_nameLabel);
con2.add(l_passLabel);
con2.add(l_jtf);
con2.add(l_jpf);
con2.add(l_jb);
this.add(l_jp);
l_jb.addActionListener(this);
this.setVisible(true);
this.setResizable(false);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
//repaint();
}