Textfield in Java using Applet

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
 * 
 * 
*/
public class text extends Applet implements ActionListener
{
    TextField lang,ver;
    public void init()
    {
        Label langx=new Label("Programming Language : ",Label.RIGHT);
        Label verx=new Label("Version : ",Label.RIGHT);
        lang=new TextField(15);
        ver=new TextField(10);
        add(langx);
        add(lang);
        add(verx);
        add(ver);
        lang.addActionListener(this);
        ver.addActionListener(this);
    }
    public void actionPerformed(ActionEvent ae)
    {
        repaint();
    }
    public void paint(Graphics g)
    {
        g.drawString("Programming Language :"+lang.getText(),10,100);
        g.drawString("Version : "+ver.getText(),10,125);
    }
}
      
Output :

Top