Create a simple java applet that implements ActionListener using TextField

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class Blt1 extends Applet implements ActionListener{
    TextField txt;
    public void init(){
        txt=new TextField(10);
        add(txt);
        txt.addActionListener(this);
    }
    public void actionPerformed(ActionEvent ae)
    {
        String st=" ";
        st=txt.getText()+"  ";
        JOptionPane.showMessageDialog(null,st);
    }
}