0% found this document useful (0 votes)
9 views14 pages

Javamicro

The document outlines a micro-project titled 'Java-Based To-Do List Application with User Authentication and File-Based Storage' developed by students at Rajendra Mane Polytechnic. The application features a GUI for task management, user registration, and login, utilizing file-based storage for data management. It aims to enhance programming skills in Java while providing a practical tool for personal task management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

Javamicro

The document outlines a micro-project titled 'Java-Based To-Do List Application with User Authentication and File-Based Storage' developed by students at Rajendra Mane Polytechnic. The application features a GUI for task management, user registration, and login, utilizing file-based storage for data management. It aims to enhance programming skills in Java while providing a practical tool for personal task management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Java-Based To-Do List Application with User

Authentication and File-Based Storage


Micro Project

Submitted in the partial fulfilment


of requirements of MSBTE
For Second Year Diploma (SEM-
IV) in Computer Engineering by
Under
supervision of
Mrs. S. S. Kamble
(Lecturer, Department of Computer Engineering)
Mr. Muzzamil Chikkali
Mr. Sairaj Patwardhan
Mr. Abhishek Kadam
Mr. Atharva Kamble

Department of Computer Engineering,


Rajendra mane Polytechnic,
Ambav,
Devrukh, Ratnagiri-415804,
Maharashtra, India, 2024-
2025
APPROVAL SHEET

This is to certify that Atharva Kamble, Muzzamil Chikkali, Sairaj Patwardhan, Abhishek Kadam
students of Fourth Semester of Diploma in Computer Engineering of Rajendra Mane Polytechnic,
Ambav (Code:1507) have submitted the proposal for micro-project entitled ‘Java-Based To-Do List
Application with User Authentication and File-Based Storage ’ in the Subject Java Programming (Sub.
Code: 314321) for the Academic Year 2024-25. The micro-project proposal for a forementioned title has
been approved for its completion as per the MSBTE instructions.

Date:
Place: Rajendra Mane Polytechnic, Ambav, Devrukh
CERTIFICATE

This is to certify that students Atharva Kamble, Muzzamil Chikkali, Sairaj Patwardhan, Abhishek
Kadam of Fourth Semester of Diploma in Computer Engineering of Rajendra Mane Polytechnic,
Ambav (Code: 1507) have submitted the microproject and defended the viva-voice of the term work
micro-project entitled “Java-Based To-Do List Application with User Authentication and File-Based
Storage” for the Academic Year 2024-24 as prescribed in the curriculum.

Place: Rajendra Mane Polytechnic, Ambav, Devrukh


Date:

Mrs. S. S. Kamble Mr. Bodale F. R. Mr. Bhopale N. B.


Project Guide. Head of Department. Principal
First of all, team members finalized the topic after a long discussion and got it approved from our teacher. The
method and material required for the project was also finalized during the group discussion among the members.
After then each member in group collected the required data. After then we analysed the data in group. After
analysing the data, we prepared all the model on given project like introduction aim, course outcomes integrated,
action plan, actual procedure followed, actual resources used, outputs of the micro project and skill development. The
overall responsibilities of the project were completed in the following way.

Action plan
Sr. No. Details of the activity Planned start Planned Name of
Date finish Date Responsible
Team Member
1 Finalizing the topic All the Member

2 Finalizing the aim, methods All the Member


and material required
3 Collection of the data All the Member
4 Analysis of the data collected All the Member
and evaluation of important
points.
Discussion and finalization of All the Member
the information required for

chat and report


5 Preparing the project All the Member

6 Preparing the report All the Member


Introduction All the Member
Aim All the Member
Course outcomes integrated All the Member
Action plan All the Member
7 Actual procedure followed All the Member

Skill developed/learning out All the Member


of this micro-project
Editing, reviewing and All the Member
finalizing the report
8 Preparing the final PPT for All the Member
presentation
9 Presentation on the project All the Member

Resources required
Sr. No. Name of Resources / Specifications Quantity Remarks
material
1. Computer 2 GB RAM and Use computer
available in
Pentium is i3 With
language lab
MS Office & Graphics
& Internet
2. printer B & W printer & Use printer
Colour available at
computer lab
3. Printing Papers A4 size -

Name of team members


1 Atharva Kamble
2 Muzzamil Chikkali
3 Sairaj Patwardhan
4 Abhishek Kadam

Mrs. S.S. Kamble


(Supervisor)

Java-Based To-Do List Application with User Authentication and File-Based


Storage

Java GUI To-Do List Application with Login System and File Storage
1.1 Type of Project
This is a desktop-based GUI application.
1.2 Programming Language
Java (JDK 11 or above).
1.3 User Interface
Implemented using Java Swing for a professional and responsive GUI.
1.4 Data Storage
File-based system using .txt files for both user authentication and task management.
2. Introduction
This project is a beginner-friendly yet advanced Java GUI application developed as a diploma microproject.
It allows users to register, log in, and manage personal to-do tasks. The application features a graphical user
interface using Java Swing and stores user data and tasks in simple .txt files. This design simulates real-
world applications without requiring a database.
2.1 Purpose
To provide a reliable personal task manager with secure login.
2.2 Audience
Ideal for students, professionals, and anyone needing a basic task management system.
2.3 Scope
This application can be enhanced for larger-scale deployment using databases or cloud services.

3. Objective
 To build a Java application that manages daily tasks.
 To implement a secure login system.
 To demonstrate file handling and user-based data management.
 To enhance GUI programming skills using Java Swing.
 To simulate real-world application development practices.

4. Software Requirements
 Java Development Kit (JDK 11 or above)
 Visual Studio Code / IntelliJ / Eclipse
 Operating System: Windows/Linux/MacOS
 No external database required
 Java Swing library (bundled in JDK)
4.1 Optional Tools
 Git for version control
 JAR compiler for packaging

5. Key Features
5.1 User Registration and Login
o New users can register using a unique ID and password.

o Passwords are stored securely in user-specific files.

o Error handling included for incorrect login attempts.

5.2 Add Task


o Users can enter a task name and scheduled time.

o Each task is saved in a user-specific task file.

5.3 Edit Task


o Allows modifying both the task name and time.

5.4 Delete Task


o Removes selected tasks permanently.

5.5 Persistent Storage


o User data and tasks are saved in text files.

o Directories used: /users for login info, /tasks for to-do items.

5.6 User Feedback


o Pop-up dialogs provide success/failure messages for user actions.
5.7 Visual Design
o Clean and professional interface using Java Swing components like JFrame, JPanel, JLabel,
JTextField, and JButton.

6. Project Structure :

6.1 File Descriptions


 ToDoApp.java: Main source file containing all logic and GUI.
 users/: Directory for storing user credentials.
 tasks/: Directory for storing user task lists.

7. Technologies Used
 Java: Main programming language.
 Java Swing: GUI development.
 File I/O: Reading and writing user data.
 AWT & Event Handling: Managing user actions like button clicks.
7.1 Why Java?
 Platform-independent
 Strong community support
 Integrated development environments (IDEs) available for ease of development
Code :

● import javax.swing.*;
● import java.awt.*;
● import java.awt.event.*;
● import java.io.*;
● import java.util.*;

● public class ToDoApp {

● static final File USERS_DIR = new File("users");
● static final File TASKS_DIR = new File("tasks");

● static DefaultListModel<String> taskModel = new DefaultListModel<>();
● static JList<String> taskList = new JList<>(taskModel);
● static String currentUserId = null;

● public static void main(String[] args) {
● if (!USERS_DIR.exists()) USERS_DIR.mkdir();
● if (!TASKS_DIR.exists()) TASKS_DIR.mkdir();
● SwingUtilities.invokeLater(ToDoApp::showLoginScreen);
● }

● static void showLoginScreen() {
● JFrame loginFrame = new JFrame("Login");
● loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
● loginFrame.setSize(300, 200);
● loginFrame.setLayout(new GridLayout(4, 2));

● JTextField userIdField = new JTextField();
● JPasswordField passwordField = new JPasswordField();
● JButton loginButton = new JButton("Login");
● JButton registerButton = new JButton("Register");

● loginFrame.add(new JLabel("User ID:"));
● loginFrame.add(userIdField);
● loginFrame.add(new JLabel("Password:"));
● loginFrame.add(passwordField);
● loginFrame.add(loginButton);
● loginFrame.add(registerButton);

● loginButton.addActionListener(e -> {
● String userId = userIdField.getText().trim();
● String pass = new String(passwordField.getPassword()).trim();
● if (checkLogin(userId, pass)) {
● currentUserId = userId;
● loginFrame.dispose();
● showToDoApp();
● } else {
● JOptionPane.showMessageDialog(loginFrame, "Invalid
credentials. Please register.");
● }
● });

● registerButton.addActionListener(e -> {
● String userId = userIdField.getText().trim();
● String pass = new String(passwordField.getPassword()).trim();
● if (userId.isEmpty() || pass.isEmpty()) {
● JOptionPane.showMessageDialog(loginFrame, "Enter valid ID and
Password");
● return;
● }
● File userFile = new File(USERS_DIR, userId + ".txt");
● if (userFile.exists()) {
● JOptionPane.showMessageDialog(loginFrame, "User already
exists.");
● } else {
● try (PrintWriter writer = new PrintWriter(userFile)) {
● writer.println(pass);
● } catch (IOException ex) {
● ex.printStackTrace();
● }
● JOptionPane.showMessageDialog(loginFrame, "User registered!
You can now login.");
● }
● });

● loginFrame.setVisible(true);
● }

● static boolean checkLogin(String userId, String password) {
● File userFile = new File(USERS_DIR, userId + ".txt");
● if (!userFile.exists()) return false;
● try (BufferedReader br = new BufferedReader(new
FileReader(userFile))) {
● String storedPassword = br.readLine();
● return storedPassword.equals(password);
● } catch (IOException e) {
● e.printStackTrace();
● }
● return false;
● }

● static void showToDoApp() {
● JFrame frame = new JFrame("To-Do List - User: " + currentUserId);
● frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
● frame.setSize(500, 400);
● frame.setLayout(new BorderLayout());

● taskModel.clear();
● loadTasks(currentUserId);

● JPanel buttonPanel = new JPanel();
● JButton addButton = new JButton("Add Task");
● JButton editButton = new JButton("Edit Task");
● JButton deleteButton = new JButton("Delete Task");

● buttonPanel.add(addButton);
● buttonPanel.add(editButton);
● buttonPanel.add(deleteButton);

● frame.add(new JScrollPane(taskList), BorderLayout.CENTER);
● frame.add(buttonPanel, BorderLayout.SOUTH);

● addButton.addActionListener(e -> {
● JTextField taskName = new JTextField();
● JTextField taskTime = new JTextField();
● Object[] message = {
● "Task Name:", taskName,
● "Time:", taskTime
● };
● int option = JOptionPane.showConfirmDialog(frame, message, "Add
Task", JOptionPane.OK_CANCEL_OPTION);
● if (option == JOptionPane.OK_OPTION) {
● String name = taskName.getText().trim();
● String time = taskTime.getText().trim();
● if (!name.isEmpty() && !time.isEmpty()) {
● String taskEntry = name + " | Time: " + time;
● taskModel.addElement(taskEntry);
● saveTasks(currentUserId, taskModel);
● }
● }
● });

● editButton.addActionListener(e -> {
● int index = taskList.getSelectedIndex();
● if (index >= 0) {
● String current = taskModel.getElementAt(index);
● String[] parts = current.split("\\| Time: ");
● JTextField taskName = new JTextField(parts[0].trim());
● JTextField taskTime = new JTextField(parts.length > 1 ?
parts[1].trim() : "");

● Object[] message = {
● "Edit Task Name:", taskName,
● "Edit Time:", taskTime
● };
● int option = JOptionPane.showConfirmDialog(frame, message,
"Edit Task", JOptionPane.OK_CANCEL_OPTION);
● if (option == JOptionPane.OK_OPTION) {
● String name = taskName.getText().trim();
● String time = taskTime.getText().trim();
● if (!name.isEmpty() && !time.isEmpty()) {
● String taskEntry = name + " | Time: " + time;
● taskModel.set(index, taskEntry);
● saveTasks(currentUserId, taskModel);
● }
● }
● } else {
● JOptionPane.showMessageDialog(frame, "Select a task to
edit.");
● }
● });

● deleteButton.addActionListener(e -> {
● int index = taskList.getSelectedIndex();
● if (index >= 0) {
● taskModel.remove(index);
● saveTasks(currentUserId, taskModel);
● } else {
● JOptionPane.showMessageDialog(frame, "Select a task to
delete.");
● }
● });

● frame.setVisible(true);
● }

● static void loadTasks(String userId) {
● File taskFile = new File(TASKS_DIR, userId + "_tasks.txt");
● if (taskFile.exists()) {
● try (BufferedReader br = new BufferedReader(new
FileReader(taskFile))) {
● String line;
● while ((line = br.readLine()) != null) {
● taskModel.addElement(line);
● }
● } catch (IOException e) {
● e.printStackTrace();
● }
● }
● }

● static void saveTasks(String userId, DefaultListModel<String> model) {
● File taskFile = new File(TASKS_DIR, userId + "_tasks.txt");
● try (PrintWriter writer = new PrintWriter(new FileWriter(taskFile)))
{
● for (int i = 0; i < model.size(); i++) {
● writer.println(model.getElementAt(i));
● }
● } catch (IOException e) {
● e.printStackTrace();
● }
● }
● }

8. Application Flow
1. Launch the application.
2. User either registers or logs in.
3. On login success, the user is redirected to the To-Do List GUI.
4. Tasks can be added, edited, or deleted using buttons.
5. All actions automatically update the task file.
8.1 Error Handling
 Invalid credentials return clear error messages.
 Attempting to login before registration is prevented.
 File handling errors are managed with exception handling.
9. Advantages
 No need for internet or external databases.
 Great for understanding basic authentication logic.
 File-based structure simulates real-time data handling.
 GUI is clean, intuitive, and visually appealing.
 Platform-independent and can run on any machine with Java.
9.1 Educational Value
This project strengthens knowledge of:
 Object-oriented programming
 GUI event handling
 File input/output
 User interaction design

10. Conclusion
This Java microproject provides a complete package to understand file I/O, GUI development, and basic
authentication in Java. It’s ideal for diploma students aiming to impress with a clean, working, and real-life
inspired application. The separation of user data and task lists enhances privacy and provides a scalable base
for further development.
10.1 Key Learnings
 Importance of clean code structure
 GUI layout design and alignment
 Reading and writing from files securely
 Handling real-world logic with validations

You might also like