i am new to swing
hello friends,
i am new to swings and was pastly working with AWT now that i want to convert my AWT desktop application to swings i have simply placed a keyword "j" before all the components but it is not working. please have a look at the code and help me out thanks,
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class tmpswing extends JFrame implements ActionListener
{
JButton blogin;
tmpswing()
{setTitle("in constructor");
setLayout(null);
setLocation(50,50);
setVisible(true);
setSize(500,500);
JLabel lid=new JLabel("User Id",0);
lid.setLocation(150,200);
lid.setSize(50,20);
lid.setVisible(true);
add(lid);
JLabel lpassword=new JLabel("Password",0);
lpassword.setLocation(150,240);
lpassword.setSize(70,20);
lpassword.setVisible(true);
add(lpassword);
JTextField tfuid=new JTextField();
tfuid.setLocation(220,200);
tfuid.setSize(130,20);
tfuid.setVisible(true);
add(tfuid);
tfuid.setText("");
JTextField tfpassword=new JTextField();
tfpassword.setLocation(220,240);
tfpassword.setSize(130,20);
tfpassword.setVisible(true);
add(tfpassword);
tfpassword.setText("");
blogin=new JButton("Log In");
blogin.setLocation(220,300);
blogin.setSize(50,20);
blogin.setVisible(true);
add(blogin);
blogin.addActionListener(this);
setTitle("constructor ends");
}
public void actionPerformed(ActionEvent ae)
{
try{
if(ae.getSource()==blogin)
{
setTitle("login button pressed");
}
}
catch(Exception e)
{}
}
public static void main(String args[])
{
tmpswing j=new tmpswing();
}
}

