0% found this document useful (0 votes)
44 views16 pages

Ajp FM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views16 pages

Ajp FM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Develop a simple

login page

Advance Java Programming


MICROPROJECT
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

D.Y. PATIL POLYTECHNIC

Develop a simple login page


Academic year: 2024-25

Subject: Advanced Java Programming Subject code: 22517

Course: Computer Engineering Course Code:CO5I

1
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

Certificate

This is to certify that Mr. Omkar Chandrakant Jamdar Roll No: 54 of 5th Semester diploma
in Computer Engineering of Institute, D.Y. Patil Polytechnic (Instt.Code: 0996) has
completed the Micro-Project in course Advance Java Programming (22517) for the academic
year 2024-2025 as prescribed in the curriculum.

Place: Ambi Enrollment No: 2209960090

Date: ……………………… Exam Seat No: …………

Subject Teacher Head of the Department Principal

2
Sr.
No Index Page no

1 Introduction 4

2 Technology used 5

3 Implementation ( Source code ) 6

4 Implementation pictures 10

5 Conclusion 11

6 Bibliography 12

7 Weekly Progress Report 14

8 Annexure II 15

3
***Introduction***

What is a Login Page ?


A login page is a web page that allows users to access a website, application, or system by
entering their credentials (username and password).

Key Components of a Login Page


1. Username field
2. Password field
3. Login button
4. Registration link (optional)
5. Forgot password link (optional)

Functional Requirements
1. Validate user input (check for empty fields)
2. Authenticate user credentials (compare with stored data)
3. Display error messages for invalid credentials
4. Redirect to a dashboard or home page upon successful login

Non-Functional Requirements:
1. Security (encrypt passwords, use HTTPS)
2. Usability (simple and intuitive design)
3. Performance (fast login process)

4
***Technologies Used:***

Java swing

Swing is a Java Foundation Classes [JFC] library and an extension of the Abstract
Window Toolkit [AWT]. Java Swing offers much-improved functionality over AWT,
new components, expanded components features, and excellent event handling with
drag-and-drop support.

Swing has about four times the number of User Interface [UI] components as AWT
and is part of the standard Java distribution. By today’s application GUI requirements,
AWT is a limited implementation, not quite capable of providing the components
required for developing complex GUIs required in modern commercial applications.
The AWT component set has quite a few bugs and does take up a lot of system
resources when compared to equivalent Swing resources. Netscape introduced its
Internet Foundation Classes [IFC] library for use with Java. Its Classes became very
popular with programmers creating GUI’s for commercial applications.

➢ Swing is a Set of API (API- Set of Classes and Interfaces)


➢ Swing is Provided to Design Graphical User Interfaces
➢ Swing is an Extension library to the AWT (Abstract Window Toolkit)
➢ Includes New and improved Components that have been enhancing the looks
and Functionality of GUIs’
➢ Swing can be used to build (Develop) The Standalone swing GUI Apps as
Servlets and Applets
➢ It Employs model/view design architecture.
➢ Swing is more portable and more flexible than AWT, the Swing is built on top
of the AWT.
➢ Swing is Entirely written in Java.
➢ Java Swing Components are Platform-independent, and The Swing
Components are lightweight.
➢ Swing Supports a Pluggable look and feel and Swing provides more powerful
components.
➢ Such as tables, lists, Scrollpanes, Colourchooser, tabbed pane, etc.
➢ Further Swing Follows MVC.

5
***Implementation***

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.RandomAccessFile;
public class Login extends JFrame implements ActionListener {
JLabel l1, l2, l3; //label for email and password
JTextField tf1; // email field
JButton btn1; // login button
JPasswordField p1; // password field
file f = new File(“C:\\Files”); //file path
int ln;
// create folder in which record is save
void createFolder() {
if (!f.exists()) {
f.mkdirs();
}
}
//check file is exist or not
void readFile() {
try {
FileReader fr = new FileReader(f + \\logins.txt);
System.out.println(“file exists!”);
} catch (FileNotFoundException ex) {
try {

6
FileWriter fw = new FileWriter(f + \\logins.txt);
System.out.println(“File created”);
} catch (IOException ex1) {
}
}
}
// login logic
void logic(String usr, String pswd) {
try {
RandomAccessFile raf = new RandomAccessFile(f + \\logins.txt, “rw”);
for (int i = 0; i < ln; i += 7) {
System.out.println(“count “ + i);
String forUser = raf.readLine().substring(6);
String forPswd = raf.readLine().substring(9);
System.out.println(forUser + forPswd);
if (usr.equals(forUser) & pswd.equals(forPswd)) {
JOptionPane.showMessageDialog(null, “Login Successfully!!”);
break;
} else if (i == (ln – 6)) {
JOptionPane.showMessageDialog(null, “incorrect username/password”);
break;
}
for (int k = 1; k <= 5; k++) {
Raf.readLine();
}
}
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
}

7
//count the number of lines from file
void countLines() {
try {
ln = 0;
RandomAccessFile raf = new RandomAccessFile(f + \\logins.txt, “rw”);
for (int i = 0; raf.readLine() != null; i++) {
ln++;
}
System.out.println(“number of lines:” + ln);
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
}
Login() {
setTitle(“Login Form in Windows Form”);
setVisible(true);
setSize(800, 800);
setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
l1 = new JLabel(“Login Form in Windows Form:”);
l1.setForeground(Color.blue);
l1.setFont(new Font(“Serif”, Font.BOLD, 20));
l2 = new JLabel(“Enter Email:”);
l3 = new JLabel(“Enter Password:”);
tf1 = new JTextField();
p1 = new JPasswordField();
btn1 = new JButton(“Submit”);
l1.setBounds(100, 30, 400, 30);
l2.setBounds(80, 70, 200, 30);
l3.setBounds(80, 110, 200, 30);

8
tf1.setBounds(300, 70, 200, 30);
p1.setBounds(300, 110, 200, 30);
btn1.setBounds(150, 160, 100, 30);
add(l1);
add(l2);
add(tf1);
add(l3);
add(p1);
add(btn1);
btn1.addActionListener(this);
} public void actionPerformed(ActionEvent e) {
showData();
} public void showData() {
JFrame f1 = new JFrame();
JLabel l, l0;
String str1 = tf1.getText();
char[] p = p1.getPassword();
String str2 = new String(p);
atry {
createFolder();
readFile();
countLines();
logic(str1, str2);
} catch (Exception ex) {
System.out.println(ex);
}
} public static void main(String arr[]) {
new Login();
}
}

9
***Implementation pictures***

10
***Conclusion***

Developing a simple login page micro project is a great way to practice web development
skills, including HTML, CSS, JavaScript, and backend programming languages like PHP or
Python. This micro project helps you understand the basics of user authentication, validation,
and session management.

❖ Key Takeaways:
1) Understand the importance of user authentication and validation.
2) Learn HTML, CSS, and JavaScript for frontend development.
3) Familiarize yourself with backend programming languages (PHP/Python).
4) Implement database connectivity (MySQL/PostgreSQL).
5) Understand security best practices (password hashing, salting).

❖ Skills Acquired:
1) Frontend development (HTML, CSS, JavaScript)
2) Backend development (PHP/Python)
3) Database management (MySQL/PostgreSQL)
4) User authentication and validation
5) Security practices

❖ Future Enhancements:
1) Implement password recovery and reset functionality.
2) Add two-factor authentication.
3) Use more secure password hashing algorithms.
4) Integrate social media login options.
5) Develop a more robust and scalable architecture.

❖ Lessons Learned:
1) Importance of secure coding practices.
2) Balancing functionality and usability.
3) Debugging and troubleshooting techniques.
4) Collaboration and version control (Git).
5) Continuous learning and improvement.

11
***Bibliography***

❖ Books:

1) "HTML and CSS: Design and Build Websites" by Jon Duckett


2) "JavaScript and DOM Scripting" by John Resig
3) "PHP and MySQL Web Development" by Luke Welling and Laura Thomson
4) "Python Crash Course" by Eric Matthes
5) "Web Development and Design Foundations" by Terry Felke-Morris

❖ Online Resources:

1) W3Schools (HTML, CSS, JavaScript, PHP, MySQL tutorials)


2) FreeCodeCamp (Web development tutorials and certification)
3) Stack Overflow (Q&A platform for programmers)
4) Mozilla Developer Network (Web development documentation)
5) GitHub (Version control and collaboration platform)

❖ Articles:

1) "The Ultimate Guide to Building a Secure Login System" by OWASP


2) "Best Practices for Password Storage" by SecurityWeek
3) "Implementing Two-Factor Authentication" by Authy
4) "The Importance of Input Validation" by OWASP
5) "Secure Coding Practices for Web Developers" by SANS Institute

12
❖ Research Papers:

1) "A Study on Secure Login Systems" by International Journal of Advanced Research in


Computer Science
2) "An Analysis of Password Security" by Journal of Cyber Security
3) "Web Application Security: A Survey" by Journal of Web Engineering
4) "Two-Factor Authentication: A Review" by International Journal of Network Security
5) "Secure Coding Practices for Web Development" by Journal of Software Engineering

❖ Websites:

1) OWASP (Open Web Application Security Project)


2) W3C (World Wide Web Consortium)
3) Mozilla (Web development resources)
4) GitHub (Open-source projects and tutorials)
5) CodePen (Front-end development community)

❖ Journals:

1) Journal of Web Engineering


2) International Journal of Advanced Research in Computer Science
3) Journal of Cyber Security
4) Journal of Software Engineering
5) IEEE Transactions on Dependable and Secure Computing

This bibliography provides a comprehensive list of resources for further learning and research
on developing a simple login page microproject.

13
***Weekly Progress Report***

Sr.no Week Activity Performed Sign of Date


guide
1 1st Discussion and finalization of topic

2 2nd Preparation and submission of


Abstract

3 3rd Literature Review

4 4th Collection of Data

5 5th Collection of Data

6 6th Discussion and outline of Content

7 7th Formulation of Content

8 8th Editing and proof Reading of


Content

9 9th Compilation of Report And


Presentation

10 10th Seminar

11 11th Viva voce

12 12th Final submission of Micro Project

Sign of teacher:- Sign of student

14
***ANEEXURE II***

Evaluation Sheet for the Micro Project

Academic Year: 2024-2025 Name of Faculty: Prof. Shubhangi Shiwankar mam


Course : Computer Engineering Course code: CO-5-I Semester: Fifth

Title of the project: Develop a simple login page

CO’s addressed by Micro Project: Need of existence of login pages


Major learning outcomes achieved by students by doing the project
• Practical outcome: We learnt to develop login pages using frontend, backend,
and database languages.
• Unit outcomes in Cognitive domain: Understanding the needs of login pages
Outcomes in Affective domain:
✓ Function as team member
✓ Follow Ethics
Comments/suggestions about team work /leadership/inter-personal communication (if
any)
Roll Name Marks out of Marks out of Total
no 6 for 4 for out of
performance in Performance in 10
group activity oral/
Presentation
52 Krushna Vikas
Deshpande
53 Sanika Sunil Chavan

54 Omkar Chandrakant
Jamdar

Name and Signature of faculty

15

You might also like