Create swing applet that contain text field, password field and command button
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/*
<applet code="login" width=200 height=200>
</applet>
*/
public class login extends JApplet
{
Container c;
JLabel j1,j2;
JTextField t1,t2,t3;
JPasswordField p1;
JButton b1,b2;
public void init()
{
c=this.getContentPane();
c.setLayout(new GridLayout(4,1));
j1=new JLabel("user name:");
c.add(j1);
t2=new JTextField();
c.add(t2);
j2=new JLabel("Password:");
c.add(j2);
p1=new JPasswordField();
c.add(p1);
b1=new JButton("OK");
c.add(b1);
b2=new JButton("Cancel");
c.add(b2);
}