Shravani Ajp Project
Shravani Ajp Project
ProjectReportOn
“Basic Drawing Application”
Mr.A.B.Gaikwad
CERTIFICATE
This is to certify that Ms. Masiha Silviya Santosh roll no. 32 of 5th Semester of diploma in
Computer engineering has completed the term work satisfactorily in Advance Java
Programming Scripting (programming with python -) For academic year 2024-2025 as
prescribed in the curriculum.
Date :- Seat No :-
ACKNOWLEDGMENT
The success and final outcomes of this project required substantial guidance and assistance from
many individuals, and I feel privileged to have received their support throughout the process.
My achievements are a direct result of their supervision, and I want to express my gratitude.
I am especially thankful to my project guide, Mr. A.B. Gaikwad sir, and the Head of the
Computer Department. Their keen interest in my work and consistent guidance were
instrumental in navigating the challenges I faced. I greatly appreciate their valuable insights and
unwavering support, which were crucial to the successful completion of my project.
I would also like to thanks to our principal Mr. Andhare sir who gave me the golden opportunity
to do this wonderful project that helped mein doing a lot of research and I came to know about
so many new things.Lastly, I thank the Almighty, my parents, and my classmates for their
constant encouragement, without which this assignment would not have been possible.
Your Sincerely,
Masiha Silviya
INDEX
Content
1. Rationale........................................................................................5
2. Aimofthemicroproject...................................................................5
3. Courseoutcomesaddressed............................................................5
4. Literaturereview
1. Steps For Project Implementation..................6
2. Program…………………………………..7-10
3. Explaination of Program………………...11-12
5. ActualMethodology………………………………………….…13
6. Actual Resources required…………………………....................13
7. OutputoftheProject................................................................14-15
8. Skilldeveloped/learningoutofthismicroproject…………............16
9. Application of the Project...........................................................16
10.Conclusion...................................................................................16
11.FutureScope.................................................................................16
12.References....................................................................................17
MICROPROJECT REPORT
Basic Notepad Application
1.0 Rationale:
This project focuses on the development of a Basic Notepad Application. A robust notepad
application is a fundamental utility for managing and editing text documents. It provides users
with essential tools for creating, saving, and opening files while fostering productivity and
efficiency. Moreover, it showcases key programming concepts such as event handling, GUI
development, and file I/O operations.
The application demonstrates how a simple text editor can streamline everyday tasks by offering
basic functionality like editing, saving, and retrieving text data. This project highlights the
significance of interactive user interfaces and the practical implementation of Java programming
concepts.
The goal of this Basic Notepad Application project is to create an efficient, user-friendly text
editing tool that simplifies the process of writing, editing, and managing text files. The system
aims to provide users with an intuitive interface for creating and saving documents, while
ensuring essential functionalities like opening existing files, editing content, and saving changes
seamlessly. Additionally, it demonstrates key programming concepts, such as event handling
and file management, in a practical and accessible manner.
5
GOVERNMENT POLYTECHNIC DHARASHIV
Step 1: Setup.
PROGRAM
Import javax.swing.*;
Import java.awt.event.*;
Import java.io.*;
// Constructor
Public BasicNotepad() {
// Initialize the frame
setTitle(“Basic Notepad”);
setSize(800, 600);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Initialize the text area and add it to the frame with a scroll pane
textArea = new JTextArea();
JScrollPanescrollPane = new JScrollPane(textArea);
Add(scrollPane);
7
GOVERNMENT POLYTECHNIC DHARASHIV
8
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
@Override
Public void actionPerformed(ActionEvent e) {
If (e.getSource() == newItem) {
// New file: clear the text area
textArea.setText(“”);
} else if (e.getSource() == openItem) {
// Open file: Show input dialog to ask for the file name
String fileName = JOptionPane.showInputDialog(this, “Enter the file name to
open:”);
If (fileName != null) {
File file = new File(fileName);
If (file.exists()) {
Try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
textArea.read(reader, null);
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, “Error opening file!”, “Error”,
JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(this, “File not found!”, “Error”,
JOptionPane.ERROR_MESSAGE);
}
}
} else if (e.getSource() == saveItem) {
// Save file: Show input dialog to ask for the file name
String fileName = JOptionPane.showInputDialog(this, “Enter the file name to
save:”);
If (fileName != null) {
File file = new File(fileName);
Try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
textArea.write(writer);
JOptionPane.showMessageDialog(this, “File saved successfully!”);
} catch (IOException ex) {
9
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
10
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
Explanation of Program
The provided Java code is a basic implementation of a Notepad Application using the Swing
library. Below is a detailed explanation of its components:
1.Import Statements
Javax.swing.*: Provides classes for creating the GUI components like JTextArea,
JMenuBar, and JFrame.
Java.awt.event.*: Allows handling user interactions (like clicking buttons or menu
items).
Java.io.*: Facilitates file handling operations (read/write files)
2. Class Declaration
3. Instance Variables
4. Constructor
11
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
5. Event Handling
6. Main Method
The main method creates an instance of the BasicNotepad class, launching the application.
12
GOVERNMENT POLYTECHNIC DHARASHIV
5.0 ActualMethodologyFollowed:
3. Implementation:
Built the application using Java programming
13
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
C) Saving File –
14
GOVERNMENT POLYTECHNIC DHARASHIV
15
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
10.0 Conclusion :-
The Basic Notepad Application successfully demonstrates the implementation of a
lightweight, user-friendly text editor using Java. It provides essential functionalities such as
creating, opening, editing, and saving text files while showcasing core programming
concepts like GUI development, event handling, and file I/O.
12.0 References:-
16
Basic Notepad Application
GOVERNMENT POLYTECHNIC DHARASHIV
www.geeksforgeeks.com
www.wikipedia.com
www.stackoverflow.com
17