```
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;

import java.awt.event.ActionEvent;

public class ex12 extends JFrame implements ActionListener     {

     JPanel contentPane;
     JTextField textField;
     JTextField textField_1;
     JTextField textField_2;
     JTextField textField_3;
     JTextField textField_4;
     JTextField textField_5;

    public ex12() {
        setTitle("Student marks");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 472, 411);
        contentPane = new JPanel();
        contentPane.setBorder(null);
        contentPane.setLayout(null);
        setContentPane(contentPane);

        JLabel lblNewLabel = new JLabel("Name");
        lblNewLabel.setBounds(62, 61, 46, 14);
        contentPane.add(lblNewLabel);

        textField = new JTextField();
        textField.setBounds(153, 58, 86, 20);
        contentPane.add(textField);
        textField.setColumns(10);

        JLabel lblNewLabel_1 = new JLabel("m1");
        lblNewLabel_1.setBounds(62, 108, 46, 14);
        contentPane.add(lblNewLabel_1);

        textField_1 = new JTextField();
        textField_1.setBounds(153, 105, 86, 20);
        contentPane.add(textField_1);
        textField_1.setColumns(10);

        JLabel lblNewLabel_2 = new JLabel("m2");
        lblNewLabel_2.setBounds(62, 157, 46, 14);
        contentPane.add(lblNewLabel_2);

        textField_2 = new JTextField();
        textField_2.setBounds(153, 154, 86, 20);
        contentPane.add(textField_2);
        textField_2.setColumns(10);

        JLabel lblNewLabel_3 = new JLabel("tot");
        lblNewLabel_3.setBounds(62, 213, 46, 14);
        contentPane.add(lblNewLabel_3);

        textField_3 = new JTextField();
        textField_3.setBounds(153, 210, 86, 20);
        contentPane.add(textField_3);
        textField_3.setColumns(10);

        JLabel lblNewLabel_4 = new JLabel("Avg");
        lblNewLabel_4.setBounds(62, 270, 46, 14);
        contentPane.add(lblNewLabel_4);

        textField_4 = new JTextField();
        textField_4.setBounds(153, 267, 86, 20);
        contentPane.add(textField_4);
        textField_4.setColumns(10);

        JLabel lblNewLabel_5 = new JLabel("Grade");
        lblNewLabel_5.setBounds(62, 317, 46, 14);
        contentPane.add(lblNewLabel_5);

        textField_5 = new JTextField();
        textField_5.setBounds(153, 314, 86, 20);
        contentPane.add(textField_5);
        textField_5.setColumns(10);

        JButton ok = new JButton("Ok");
        ok.setBounds(313, 73, 89, 23);
        contentPane.add(ok);

        ok.addActionListener(new ActionListener() 

        {

            public void actionPerformed(ActionEvent arg0) {

                double bsal,tax,allo,nsal;

                if (arg0. getSource().equals(ok))
                {

                    if(bsal > 5000 )
                    {

                        tax = bsal * 0.15;
                        allo = bsal * 0.2;
                    }
                    else if (bsal > 30000)
                    {
                        tax = bsal * 0.5;
                        allo = bsal * 0.1;
                    }
                    else if (bsal > 20000)
                    {
                        tax = 0;
                        allo = 0;
                    }
                    else
                    {
                        tax = 0;
                        allo = 0;
                    }

                }   

            }
        });

    }
    public static void main(String[] args) {

        ex12 e = new ex12();
        e.show();

    }

}

```

above program i tried to write `ActionListener` it is giving error.
this is code 

`public class ex12 extends JFrame implements ActionListener`

i wrote this program on eclipse

please any one fix this error