Thanks for the suggestion You are correct that was a mistake....
but when i put it inside the program i am getting following error....
==================================================
anu.java:6: anu is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
public class anu extends JApplet implements ActionListener
================================================== ====
just pasting the whole program again
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
public class anu extends JApplet implements ActionListener
{
JLabel j1, j2,j3, j4;
JTextField t1,t2,t3,t4;
JButton b1,b2;
JFrame f1;
JPanel p1;
public void init()
{
Container c = getContentPane();
c.setLayout(new FlowLayout());
/*p1.add(f1);*/
f1.add(c);
f1.setVisible(true);
j1=new JLabel("enter your name");
f1.add(j1);
t1=new JTextField(10);
f1.add(t1);
j2=new JLabel("enter your age");
f1.add(j2);
t2=new JTextField(10);
f1.add(t2);
j3=new JLabel("enter your sex");
f1.add(j3);
t3=new JTextField(10);
f1.add(t3);
j4=new JLabel("enter your email id");
f1.add(j4);
t4=new JTextField(10);
f1.add(t4);
b1=new JButton("Submit");
f1.add(b1);
b2=new JButton("Cancel");
f1.add(b2);
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
t1.setText(" ");
t2.setText(" ");
t3.setText(" ");
t4.setText(" ");
}
});
b2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
String rin;
rin=t4.getText();
if (rin=="rinki")
JOptionPane.showMessageDialog(f1,"great");
else
JOptionPane.showMessageDialog(f1,"bad");
}
});
}
};