jpanel能不能设置透明的,求解~!
想做QQ登陆框,package com.xaeduask;
import java.awt.Container;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class QQ {
public static void main(String[] args) {
JFrame jf=new JFrame("QQ2012");
jf.setLayout(null);
ImageIcon img1=new ImageIcon("src/img/630.jpg");
ImageIcon img2=new ImageIcon("src/img/tou.jpg");
JLabel jl1=new JLabel(img1);
jl1.setBounds(0, 0, 382, 282);
Container con=jf.getContentPane();
con.getBackground();
con.add(jl1);
jf.setVisible(true);
jf.setSize(382,282);
jf.setLocationRelativeTo(null);
jf.setDefaultCloseOperation(3);
}
}
想在背景图上放一个janbel ,但是想弄成透明的,jpanel能放组件,也能看到后面的背景图,求解高手!