hi,
pls help me with adding background image to this code...i tried many ways im unsuccessful...pls help me urgent!!!
code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class updateid implements ActionListener,FocusListener
{
private JFrame f;
private JLabel l1,l2;
private JTextField tf1;
private JButton b1,b2;
public updateid()
{
f=new JFrame("UPDATE EMPLOYEE");
l1=new JLabel("Update Employee");
l2=new JLabel("Enter Employee ID");
tf1=new JTextField();
b1=new JButton("Submit");
b2=new JButton("Back");
}
public void launchframe()
{
f.setLayout(null);
f.add(l1);
f.add(l2);
f.add(tf1);
f.add(b1);
f.add(b2);
l1.setBounds(550,200,150,25);
l2.setBounds(500,250,150,25);
tf1.setBounds(650,250,75,25);
b1.setBounds(500,300,75,25);
b1.addActionListener(this);
b2.setBounds(600,300,75,25);
b2.addActionListener(this);
f.setSize(2000,2000);
f.setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
updateemp ue=new updateemp();
ue.launchframe();
f.setVisible(false);
}
if(e.getSource()==b2)
{
adminfunc af=new adminfunc();
af.launchframe();
f.setVisible(false);
}
}
public void focusLost(FocusEvent fe)
{}
public void focusGained(FocusEvent fe1)
{}
public static void main(String args[])
{
updateid ui=new updateid();
ui.launchframe();
}
}
thanks in advance