# Write a program to create a registration form using AWT

- Link: https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/
- Published: 2018-11-07T13:29:45+05:30
- Author: Ashishkumar Vishwakarma

In this, I will show you how to create a registration form using AWT feature.

## What is AWT?

AWT (Abstract Windowing Toolkit) is a feature in java that provides multiple classes
for creating GUI views. AWT is almost similar to SWING, it’s just AWT display is
simpler than SWING.

For a bit of reference too, GUI is an interface view. Its function is to facilitate
the user in accessing the computer.

## Write a program to create a registration form using AWT

 Also, you can use the Java [compiler](https://www.onlinegdb.com/online_java_compiler)
to compile a program.

### Source code:

    ```wp-block-code
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class loginform extends Frame implements ActionListener
    {
    	Label l1=new Label("User name : ");//OBJECT CREATE 
    	Label l2=new Label("Surname : ");//OBJECT CREATE
    	Label l3=new Label(" ");//OBJECT CREATE
    	TextField t1=new TextField();//OBJECT CREATE
    	TextField t2=new TextField();//OBJECT CREATE
    	Button b=new Button("submit");//OBJECT CREATE
    	public loginform()
    	{
                    add(l1);
    		add(t1);
    		add(l2);
    		add(t2);
    		add(b);
    		add(l3);
    		l1.setBounds(20,45,70,20);//set co-ordinates 
    		t1.setBounds(180,45,200,20);
    		l2.setBounds(20,95,70,20);
    		t2.setBounds(180,95,200,20);
    		b.setBounds(150,150,100,50);
    		b.addActionListener(this);
    		addWindowListener(new A());
    	}
    	public void actionPerformed(ActionEvent e)
    	{ 
    		l3.setText("SUBMITTED "+t1.getText());
    	}
    	public static void main(String s[])
        {
    		loginform l=new loginform();
    		l.setSize(new Dimension(400,400));
    		l.setTitle("Login");
    		l.setVisible(true);
       }//end of main
    }//end of class loginform
     class A extends WindowAdapter
    { 
    	public A(){}
    	public void WindowClosing(WindowEvent e)
       { 
    	System.exit(0);
       }
    }//end of class A
    ```

### Output.

> C:\A>javac loginform.java
> C:\A>java loginform

![create a registration form using AWT.](https://technotaught.com/wp-content/uploads/
2018/11/sds.png)

Also view:–  [Write a Java program to create a window using swing.](https://technotaught.com/22-write-a-java-program-to-create-a-window-using-swing/)

Also view:– [How to remove Personalisation Ads?](https://technotaught.com/how-to-remove-personalisation-ads/)
In Mobile.

### Share this:

 * [  X ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=twitter)
 * [  Facebook ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=facebook)
 * [More](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/#)

 * [  WhatsApp ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=jetpack-whatsapp)
 * [  LinkedIn ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=linkedin)
 * [  Email ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?subject=%5BShared%20Post%5D%20Write%20a%20program%20to%20create%20a%20registration%20form%20using%20AWT&body=https%3A%2F%2Ftechnotaught.com%2Fwrite-a-program-to-create-a-registration-form-using-awt%2F&share=email)
 * [  Reddit ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=reddit)
 * [  Tumblr ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=tumblr)
 * [  Pinterest ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=pinterest)
 * [  Telegram ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/?share=telegram)
 * [  Print ](https://technotaught.com/write-a-program-to-create-a-registration-form-using-awt/#print?share=print)

### _Related_
