I am not getting this program since i beginner to applet programming
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/*<applet code=Login height=500 width=300></applet>*/
public class Login extends JApplet implements ActionListener
{
JLabel jl1,jl2,jl3,jl4,jl5;
JTextField jt;
JPasswordField jp1,jp2;
JButton jb;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
jl1=new JLabel("Username : ");
jl2=new JLabel("Password : ");
jl3=new JLabel("Confirm password : ");
jl4=new JLabel();
jl5=new JLabel();
jt=new JTextField(20);
jp1=new JPasswordField(20);
jp2=new JPasswordField(20);
jb=new JButton("Login");
jb.addActionListener(this);
c.add(jl1);
c.add(jt);
c.add(jl2);
c.add(jp1);
c.add(jl3);
c.add(jp2);
c.add(jb);
c.add(jl4);
c.add(jl5);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
String p1,p2;
if(jp1==jp2)
{
jl4.setText("Welcome");
}
else
{
jl4.setText("Password Mismatch");
}
}
}
everytime i check my program it shows else condition
whether password fields are same or different
is there anyone who can help me?