Professional Documents
Culture Documents
Acknowledgement of Registration Form
Acknowledgement of Registration Form
Almost we have completed all basic java swing components in this java swing
tutorial series .Now it is time to integrate all the basic components together.
Today in this post I’m gone create a registration form using java
swing components. This tutorial will cover all the swing components which I have
already explained. Generally, we use a registration form to register the necessary
details in the database. If you are an absolute beginner in java swing or if you
didn’t go through my previous posts then no need to worry. Here I will be dealing
all the basic java swing components one by one. So let’s start. Before creating a
registration form we should aware of it.
In java swing, we create a frame using JFrame class which is already defined
in javax.swing package.
Import the necessary package like javax.swing.* and java.awt.*;
Create a class with any name and save it using the class name with .java
extension. In my case it is RegForm.java
Step 1: Creating a Frame using JFrame class
Create an object of the JFrame class and inside its constructor pass some
string to set the title of the JFrame. You can also use setTitle() method to set
the title.
Set its visibility to true using setVisible() method. This method takes the
only boolean value as the argument. Boolean value true will make it visible
to the screen.
Now use setBounds() method to set the location and size of the JFrame.
This method takes four integer values as the argument. The first two
arguments are the location which measures the co-ordinate of x and y-axis
respectively. The last two arguments are for size which specifies pixels.
Use setDefaultCloseOperation() method to exit the Frame when you
terminate the execution. Pass an argument as JFrame.EXIT_ON_CLOSE.
Once the program execution is terminated the background execution will
stop.