Hi,
just trying my hands on gui.
made a form using borderlayout, but tried with other layouts too.
not getting the look and feel as the general forms look like.

other thing is that how can use the paint method here in the program give so as to display the values of name and password.


thanks in advance
rojer

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class form1 extends Applet
{
Panel p1=new Panel();
Panel p2=new Panel();
Panel p3=new Panel();

Label wel = new Label("Welcome to News Front");

Label name=new Label("Enter Your Name:");
Label pwd=new Label("Enter Your Password:");
Label cpwd=new Label("Confirm Your Password:");

TextField tname=new TextField(15);
TextField pswd=new TextField(15);
TextField cpswd=new TextField(15);

Button disp=new Button("Display");
Button clr=new Button("Clear");

Label n=new Label();
Label p=new Label();

public void init()
{
setLayout(new GridLayout());
pswd.setEchoChar('*');
cpswd.setEchoChar('*');

p1.add(wel);

p2.add(name);
p2.add(tname);

p2.add(pwd);
p2.add(pswd);

p2.add(cpwd);
p2.add(cpswd);

p2.add(n);
p2.add(p);

p3.add(disp);
p3.add(clr);

disp.addActionListener(new ButtonHandler());
clr.addActionListener(new ButtonHandler());

add("North",p1);
add("Center",p2);
add("South",p3);

}
class ButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String s=e.getActionCommand();
String tn;
String tp;
if(s.equals("Display"))
{
tn=tname.getText();
n.setText(tn);
tp=cpswd.getText();
p.setText(tp);
}
else if(s.equals("Clear"))
{
n.setText("");
p.setText("");
}
}
}
}