求助:java添加图片背景
我是菜鸟,求大神帮忙给下面程序加个图片背景急!!!!求救!!!import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class jiance extends Frame implements ActionListener {
TextField t1, t2, t3, t4;
Button b1;
Button b2;
Button btnExit;
public jiance()
{
super("登陆界面");
Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
setLayout(new FlowLayout());
t1 = new TextField(20);
t1.setBackground(Color.white);
t2 = new TextField(20);
t2.setBackground(Color.white);
b1 = new Button("登陆");
b2=new Button("管理");
btnExit = new Button("退出");
add(new Label("用户名:"));
add(t1);
add(new Label("密码:"));
add(t2);
add(b1);
add(b2);
add(btnExit);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
b1.addActionListener(this);
b2.addActionListener(this);
btnExit.addActionListener(this);
setVisible(true);
setBounds(200, 200, 200, 300);
validate();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
}
if(e.getSource()==b2)
{
;
}
if(e.getSource()==btnExit)
{
System.exit(0);
}
}
public static void main(String args[]) {
jiance j=new jiance();
Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
j.setSize(d.width,d.height);
j.setLocation(0,0);
}
}