AJP Preject
AJP Preject
OF TECHNOLOGY
BHUHAGAON, SANGLI
CERTIFICATE
This is to certify that the project report entitled
Certificate
This is to certify that the following group members:
Sr.No Roll No Enrollment No Exam No Name Of Student
It is pride to present micro project report with the deep sense of gratitude. We acknowledge
our guide Mr.Ghodke.S.S. for the valuable time, guidance and inspiration. Our Sincere thanks to Mr.
M.P.Jamdar H.O.D. of Computer Department, for providing all facilities needed for our successful
completion of project. We are also thankful to Principal Mr. B. B. Patil for inspiring us to achieve highest
goal. We are thankful to all faculty members, our parents and friends who have directly and indirectly
helped us in completing our project.
Mr.Vishwajeet Jadhav
Mr.Pratik Mohite
Mr.Suraj More
Mr.Shubham Khandekar
PART A – Micro Project Proposal
Title - Login and Registration Form using Java AWT and Swing
Java AWT is an API that contains large number of classes and methods to create and manage
graphical user interface (GUI) applications. The AWT was designed to provide a common set of
tools for GUI design that could work on a variety of platforms. The tools provided by the AWT are
implemented using each platform's native GUI toolkit, hence preserving the look and feel of each
platform. This is an advantage of using AWT. But the disadvantage of such an approach is that
GUI designed on one platform may look different when displayed on another platform that means
AWT component are platform dependent.
AWT is the foundation upon which Swing is made i.e., Swing is an improved GUI API that
extends the AWT. But now a days AWT is merely used because most GUI Java programs are
implemented using Swing because of its rich implementation of GUI controls and lightweighted
nature.
The aim of this micro-project is to develop a Login and Registration Form program with
the help of java and AWT command-lines, and implement it successfully. This program is a simple
form page where you can enter your name and select gender using the radio-button and select age
then click on the button. Here you can find different options to select of age among that you can
select anyone.
1
3.0 Intended Course Outcomes
In Java, a form for entering authentication credentials to access the restricted page is referred
to as a Login form. A login form contains only two fields, i.e., username and password. Each user
should have a unique username that can be an email, phone number, or any custom username.
After submitting the login form, the underlying code of the form checks whether the credentials
are authentic or not to allow the user to access the restricted page. If the users provide unauthentic
credentials, they will not be able to forward the login form.
Swing is a part of the JFC (Java Foundation Classes). Building Graphical User Interface in Java
requires the use of Swings. Swing Framework contains a large set of components which allow a
high level of customization and provide rich functionalities, and is used to create window-based
applications. Java swing components are lightweight, platform-independent, provide powerful
components like tables, scroll panels, buttons, list, color chooser, etc.
In this article, we’ll see how to make Registration form which includes all the buttons and field in
one Form.
2
5.0 Proposed Methodology –
1) In this microproject, first of all we have focused on selection of appropriate topic for our micro
project.
2) Select the topic i.e. Login and Registration form using java awt and swing.
3) Then we started with our brief study as well as a survey on our topic.
3
7.0 Action Plan –
Team Members
Start Date Finish
Date
4
PART B – Micro Project Report
Title - Login and Registration Form using Java AWT and Swing
1.0 Rationale
Java AWT is an API that contains large number of classes and methods to create and manage
graphical user interface (GUI) applications. The AWT was designed to provide a common set
of tools for GUI design that could work on a variety of platforms. The tools provided by the
AWT are implemented using each platform's native GUI toolkit, hence preserving the look and
feel of each platform. This is an advantage of using AWT. But the disadvantage of such an
approach is that GUI designed on one platform may look different when displayed on another
platform that means AWT component are platform dependent.
AWT is the foundation upon which Swing is made i.e., Swing is an improved GUI API that
extends the AWT. But now a days AWT is merely used because most GUI Java programs are
implemented using Swing because of its rich implementation of GUI controls and lightweighted
nature.
5
3.0 Literature Review
In Java, a form for entering authentication credentials to access the restricted page is referred
to as a Login form. A login form contains only two fields, i.e., username and password. Each user
should have a unique username that can be an email, phone number, or any custom username.
After submitting the login form, the underlying code of the form checks whether the credentials
are authentic or not to allow the user to access the restricted page. If the users provide unauthentic
credentials, they will not be able to forward the login form.
Swing is a part of the JFC (Java Foundation Classes). Building Graphical User Interface in Java
requires the use of Swings. Swing Framework contains a large set of components which allow a
high level of customization and provide rich functionalities, and is used to create window-based
applications. Java swing components are lightweight, platform-independent, provide powerful
components like tables, scroll panels, buttons, list, color chooser, etc.
In this article, we’ll see how to make Registration form which includes all the buttons and field in
one Form.
1) In this microproject, first of all we have focused on selection of appropriate topic for our micro
project.
2) Select the topic i.e., Login and Registration form using java awt and swing.
3) Then we started with our brief study as well as a survey on our topic.
4) Then we gathered all information based on the topic of microproject.
6
5.0 Resources Required
Source-Code
Login Form
import java.awt.*;
import java.awt.event.*;
import java.io.*;
class form extends Frame implements ActionListener
{
private Label fname_lbl,lname_lbl,address_lbl,e_mailid_lbl;
private TextField
fname_txt,lname_txt,address_txt,e_mailid_txt; private Button
submit_btn,exit_btn,clear_btn,save_btn; private TextArea
area_txta; public form()
{
setBackground(Color.LIGHT_GRAY);
setLayout(null);
setTitle("Applicatoin Form");
setSize(650,350);
setLocation(100,100);
7
/*-------------Labels------------*/
address_lbl=new Label("Address");
address_lbl.setBounds(25,200,100,30);
add(address_lbl);
e_mailid_lbl=new Label("E-MailID");
e_mailid_lbl.setBounds(25,250,100,30);
add(e_mailid_lbl);
/*---------------TextField----------*/
fname_txt=new TextField();
fname_txt.setBounds(125,100,150,30);
add(fname_txt);
lname_txt=new TextField();
lname_txt.setBounds(125,150,150,30);
add(lname_txt);
address_txt=new TextField();
address_txt.setBounds(125,200,150,30);
add(address_txt);
e_mailid_txt=new TextField();
e_mailid_txt.setBounds(125,250,150,30);
add(e_mailid_txt);
/*-----------------Button------------*/
submit_btn=new Button("Submit");
submit_btn.setBounds(25,300,75,30);
submit_btn.addActionListener(this);
add(submit_btn);
clear_btn=new Button("Clear");
clear_btn.setBounds(125,300,75,30);
8
clear_btn.addActionListener(this);
add(clear_btn);
exit_btn=new Button("Exit");
exit_btn.setBounds(225,300,75,30);
exit_btn.addActionListener(this); add(exit_btn);
save_btn=new Button("Save");
save_btn.setBounds(450,300,75,30);
save_btn.addActionListener(this);
add(save_btn);
/*--------------TextArea-----------------*/
area_txta=new TextArea();
area_txta.setBounds(350,100,275,180);
add(area_txta);
/*---------------------------------------*/
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}
public void paint(Graphics g)
{
g.setFont(new Font("Informal Roman",Font.BOLD,30));
g.setColor(Color.blue);
g.drawString("Application Form",75,80);
g.drawLine(325,25,325,325);
g.drawLine(330,25,330,325);
}
9
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==submit_btn)
{
String str_fname=fname_txt.getText();
String str_lname=lname_txt.getText();
String str_add=address_txt.getText();
String str_e_mailid=e_mailid_txt.getText();
}
class MyDialog111 extends Dialog implements ActionListener
{ private Label lbl_msg; private
Button btn_yes,btn_no; private Panel
north_panel,south_panel;
10
public MyDialog111()
{
super(new form(),"Dialog
Demo",true); north_panel=new
Panel(); south_panel=new Panel();
north_panel.add(lbl_msg);
south_panel.add(btn_yes);
south_panel.add(btn_no);
add(north_panel,"North");
add(south_panel,"South");
btn_yes.addActionListener(this);
btn_no.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==btn_yes)
{
System.exit(0)
; } else
dispose(); } }
class IOForm
{
public static void main(String []args)
{
new form().setVisible(true);
}
}
11
Registration Form
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class MyFrame
extends JFrame
implements ActionListener {
12
14
private String years[]
= { "1995", "1996", "1997", "1998",
"1999", "2000", "2001", "2002",
"2003", "2004", "2005", "2006",
"2007", "2008", "2009", "2010",
"2011", "2012", "2013", "2014",
"2015", "2016", "2017", "2018",
"2019" };
c = getContentPane();
c.setLayout(null);
15
mno = new JLabel("Mobile"); mno.setFont(new Font("Arial",
Font.PLAIN, 20));
mno.setSize(100, 20);
mno.setLocation(100, 150);
c.add(mno); tmno = new
JTextField();
tmno.setFont(new
Font("Arial", Font.PLAIN,
15));
tmno.setSize(150, 20);
tmno.setLocation(200, 150);
c.add(tmno);
16
gengp.add(female);
17
term.setLocation(150, 400);
c.add(term);
setVisible(true);
18
}
// method actionPerformed()
// to get the action performed // by the user and act
accordingly public void
actionPerformed(ActionEvent e)
{
if (e.getSource() == sub) {
if (term.isSelected()) {
String data1;
String data
= "Name : "
+ tname.getText() + "\n"
+ "Mobile : "
+ tmno.getText() + "\n"; if (male.isSelected())
data1 = "Gender : Male"
+ "\n";
else
data1 = "Gender : Female"
+ "\n";
String data2
= "DOB : "
+ (String)date.getSelectedItem()
+ "/" + (String)month.getSelectedItem()
+ "/" + (String)year.getSelectedItem()
+ "\n";
19
}
}
20
Login Form
Registration Form
21
7.0 Skill Developed / learning out of this Micro Project
22