IP Project: Library Management System
IP Project: Library Management System
IP Project: Library Management System
Page 1 of 111
Page 2 of 111
BONAFIDE CERTIFICATE
Certified to be the bonafide record of the work done by
Master/Miss_________________________ of class XII ____
In the Computer Laboratory of M.E.S. Indian School, Doha-Qatar, during the
academic year___________________ She has performed _______assignments.
Date:_____________
School Seal
Roll Number/ registration Number
Submitted for Annual / All India Senior School Certificate Practical Examination in Informatics Practices
________________ held at M.E.S. Indian School, Doha, Qatar on __________ .
Examiner (External)
Examiner (Internal)
Signature:_________________
Signature:________________
Name:____________________
Name:____________________
Designation:_______________
Designation:_______________
Table of contents
Page 3 of 111
Page No.
1 Aim.6
2 Introduction: JAVA & MySQL7-9
3 Introduction....10-13
1.1 Problem Definition.......10
1.2 Objective & Scope.10-12
1.3 Proposed System12
1.4 Assumptions & Constraints12-13
1.5 System Requirements..13
Specific requirements.18-24
3.1 Interface requirements18
3.2 Functional requirements18-19
Page 4 of 111
Project Implementation25-107
4.1 Work Break down Structure.25
4.2 Code with reference to design.26-98
4.3 Snapshot of UI & Reports..99-107
Future Enhancements..108
Limitations.109
Conclusion..110
Bibliographies.111
Page 5 of 111
ACKNOWLEDGEMENT
I extend my sincere thanks to my school :
M.E.S INDIAN SCHOOL, which provided me with the
opportunity to fulfill my wish and achieve my goal.
I would like to express deep debt to MRS. BLESSY MARY,
project guide for her vital suggestions, meticulous guidance and
constant motivation which went a long way in the successful
completion of this project.
I cannot move on without thanking my beloved principal
MR. A.P. SHASHIDHARAN, for creating the required academic
environment which made my task appreciable.
On a moral personal note, my deepest appreciation and gratitude
to my beloved parents, who have been an inspiration and have
provided me with unrelenting encouragement and support.
Page 6 of 111
AIM:
To develop an application based on
Library Management System.
Page 7 of 111
Introduction : JAVA
Java is a computer programming language that is concurrent, classbased, object-oriented, and specifically designed to have as few implementation dependencies as
possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning
that code that runs on one platform does not needto be recompiled to run on another. Java
applications are typically compiled to byte code that can run on any Java (JVM) regardless
of computer architecture. Java is, as of 2014, one of the most popular programming languages in
use, particularly for client-server web applications, with a reported 9 million developers. [10][11] Java
was originally developed by James Gosling at Sun Microsystems (which has since merged into
Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform.
The language derives much of its syntax from C and C++, but it has fewer low-level facilities than
either of them.
The original and reference implementation Java compilers, virtual machines, and class libraries were
originally released by Sun under proprietary licenses. As of May 2007, in compliance with the
specifications of the Java Community Process, Sun relicensed most of its Java technologies under
the GNU General Public License. Others have also developed alternative implementations of these
Sun technologies, such as the GNU Compiler for Java (byte code compiler), GNU Class
path (standard libraries), and Iced Tea-Web (browser plug-in for applets).
There were five primary goals in the creation of the Java language:
1. It should be "simple, object-oriented and familiar"
2. It should be "robust and secure"
3. It should be "architecture-neutral and portable"
4. It should execute with "high performance"
5. It should be "interpreted, threaded, and dynamic"
Versions
Major release versions of Java, along with their release dates:
Page 8 of 111
Page 9 of 111
MySQL
MySQL officially, but also called "My Sequel" is (as of March 2014) the world's second most widely
used open-source relational database management system (RDBMS). It is named after cofounder Michael Widenius's daughter, My. The SQL phrase stands for Structured Query Language.
The MySQL development project has made its source code available under the terms of the GNU
General Public License, as well as under a variety of proprietary agreements. MySQL was owned
and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle
Corporation.
MySQL is a popular choice of database for use in web applications, and is a central component of
the widely used LAMP open source web application software stack (and other 'AMP' stacks). LAMP
is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects
that require a full-featured database management system often use MySQL.
For proprietary use, several paid editions are available, and offer additional functionality.
Applications which use MySQL databases
include:TYPO3, MODx, Joomla, WordPress, phpBB, MyBB, Drupal and other software. MySQL is
also used in many high-profile, large-scale websites, including Google (though not for
searches), Facebook, Twitter, Flickr, and YouTube.
Page 10 of 111
1. INTRODUCTION
1.1 Problem Definition
TO DEVELOP A LIBRARY MANAGEMENT SYSTEM.
Library Management System can be used by educat ion inst itutes to maint ain t he
records of books easily. Achieving this objective is difficult using manual system as
the informat ion is scattered, can be redundant and collect ing relevant informat ion
may be very t ime consuming. All these problems are solved using this project.
As there are many books present in library and also there are various books issued by librarians
to the members. It is very difficult to maintain huge catalogue within reasonable space
constraints manually and to maintain the same is very time and space consuming process. If we
want complete information of available books or issued books at any given point of time it is
difficult to get it. Although manual system can handle but there are some flaws in this system:
Data Redundancy.
Lot Of Paperwork Involved.
Time Consuming Process.
The system empowers the administrator to issue fines on books that are overdue.
Page 11 of 111
Scope
Without a Library management System, managing and maintaining the details of the book is a
tedious job for any college. Library management system will store all the details of the books
including their category, availability and also maintains the details about the students to whom
the books are issued.
Login module: Login module will help in authentication of user accounts. Users who
have valid login id and password can only login into their respective accounts
Search module: Suppose there are hundreds of students and from this we have to search
a particular student and we know the name of the student .In manual system it is a tedious
task though we know the name of the student, but using this module we can easily search
the student by specifying the name of the student in the search criteria. Thus this module
will help the administrator in searching the student with various criteria easily.
Addition of Books: This module helps to add the books details according to category
wise.
Deletion of Books: This module provides the admin option to delete the existing books
from the given category and the admin can delete the already existing books from the
database.
Addition of Student Details: This module helps to add and maintained the details about
the students to whom the books have been issued, the details of the students are
categories according to their courses.
Fine Module: If the student doesnt returns the books on the given due date than this
module helps to imply fine on that particular student
Admin id
Admin password
Book Details
Student id
Page 12 of 111
Existing System
According to existing manual system it very tedious and time consuming work to maintain
consistency of books record. There are large numbers of students who regularly take and returns
books and to maintain this large data manually. It takes lot of paper work and consumes more
time and place. There is also a risk of data loss because of degradation of registers, papers
misplace from register etc.
Apart from this there is risk of duplication of data and manipulation of data without prior
authority and maintaining that record and keep them safe for long period of time is very difficult.
On other hand data of particular books and students whose data is scattered in different registers
and very hard for anyone to gather data of particular student or books.
Assumptions:
This software package is developed using JAVA as front end, MS SQL as the back end
which is supported by Microsoft Windows XP.
Page 13 of 111
Constraints:
Any update regarding the availability of books, return of books, fine imposed on the
students, issued date and due date are to be recorded to have updated and correct values.
Technologies Used:
Software Requirements:
Hardware Requirements:
20 GB HDD or Higher
Network Connectivity
Page 14 of 111
Functional Requirements
Performance Requirements
Page 15 of 111
START
Login
Books
Members
Add Books
Add
Members
List All
Books
List
Available
Books
Search
Loan
Reserve
Borrow a
Book
Reserve a
Book
List All
Members
Return A
Book
Edit
Members
Issued
Book
Details
List
Borrowed
Books
Remove
Members
Edit Books
Member
Info
Remove
Books
STOP
Page 16 of 111
Add, view, modify, search and delete all the details of Books.
User Characteristics:
Users of this system are librarian of the college who is administrator who maintains the system.
The librarian should have basic knowledge of computers and internet browsing. The
administrator should have some more knowledge, much about the system modules. So the admin
can rectify problems caused due to catastrophic failures like hardware or power failures. Friendly
graphical user interface and documents with the system will be sufficient to educate a user on
how to use the system effectively, without any problems or difficulties. General users with basic
computer skills can use this software.
Knowledgeable User
Novice User
Expert User
Page 17 of 111
Along with the system, the following third party programs will be required for the best
experience:
Netbeans IDE.
MySQL.
Page 18 of 111
Login
Admin
o Add Edit, Remove and Search Borrowers.
o Add Edit, Remove and Search Borrowed books.
o Add Edit, Remove and Search Books.
o Search and Preview due dates of the Books.
o Search and Preview Returned dates of the Books.
o Add Edit, Remove and Search Categories.
o Add and Remove Yearly Records.
o Add Edit, Remove and Search Sections.
Page 19 of 111
Deletion of Records:
Admin has rights to delete different types of records like books, borrowers, categories and other
records.
Editing:
Admin can edit the details related to books, category of books, borrowers, due date and returned
date.
Page 20 of 111
Type
CONSTRAINT
BookID
integer
Primary Key
Subject
varchar(20)
Not Null
Title
varchar(20)
Not Null
Author
varchar(20)
Not Null
Publisher
Varchar(20)
Not Null
Copyright
integer
Not Null
Edition
integer
Not Null
Pages
integer
Not Null
ISBN
Varchar(50)
Not Null
NumberOfBooks
Integer
Not Null
NumberOfAvailabeBooks
Integer
Not Null
NumberOfBorrowedBooks integer
Not Null
Library
Varchar(10)
Not Null
Available
integer
Not Null
ShelfNo
integer
Not Null
Page 21 of 111
Borrow
Column
Type
CONSTRAINT
BookID
integer
Foreign Key
MemberID
varchar(20)
Foreign Key
DayOfBorrowed
varchar(20)
Not Null
DayOfReturn
varchar(20)
Not Null
Column
Type
CONSTRAINT
MemberID
integer
Primary Key
ID
integer
Not Null
Password
varchar(20)
Not Null
NAME
varchar(20)
Not Null
varchar(20)
Major
varchar(20)
Not Null
NumberOfBooks
integer
Not Null
Mony
integer
Not Null
Expired
datetime
Not Null
Members
Page 22 of 111
Design Phase
Development Phase
Coding Phase
Testing Phase
Implementation Phase
Page 23 of 111
REQUIREMENT ANALYSIS
This phase includes the definition of the problem. In order to identify the problem: we have to
know information about the problem the purpose of the evaluation for the problem to be known.
To know the clients requirements and the objectives of the project, a questionnaire was prepared
and the client was made to answer it. On the basis of the questionnaire, the problem is defined
and evaluated. The SRS is made and requirement analysis is done.
DESIGN
Software design is processes through which the requirements are translated into are presentation
of software. The design of the system is in modular form i.e. the software is logically partitioned
into components that perform specific functions and sub functions. The
Design Phase leads to modules like process selection which exhibit independent functional
characteristics .These modules arent interconnected. It even leads to interfaces that reduce the
complexity of the connections between modules and with that external environment.
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 24 of 111
DEVELOPMENT
The development phase includes choosing of a suitable s/w to solve the particular problem given
the various facilities and the sophistication in the selected software gives a better development of
the problem. Here the software was built using. The data is stored in Database files for easier
access.
CODING
The coding phase is for retranslating the design of the system produced during the design phase
into code in a given programming language which can be executed by a computer and which
performs the computation specified by the design. We have used JAVA language and its basic
concepts for coding the software system.
TESTING
Testing is done in various ways such as testing the algorithm, programming code, sample data
debugging is one. Testing has been done by checking each and every module and also to check
the validations.
IMPLEMENTATION
After testing is over project is implemented by providing training to the users and providing
manuals so that they can be refreshed as and when needed.
POST IMPLEMENTATION
If any problem occurs after the implemented they are removed from time to time so that so that
the users can work on the prepared system easily finally a satisfied user when all things are
almost right.
Page 25 of 111
4. PROJECT IMPLEMENTATION
4.1 Work Breakdown Structure
Library Management
System
Books
Members
Search
Loan
Add
Add
Borrow
List All
List All
Return
Edit
Details
Available
Borrowed
Edit
Reserve
Remove
Info
Remove
Help
About Us
Page 26 of 111
Page 27 of 111
" The book subject: ", " The book title: ",
" The name of the Author(s): ", " The name of the Publisher: ",
" Copyright for the book: ", " The edition number: ", " The number of Pages: ",
" ISBN for the book: ", " The number of copies: ", " The name of the Library: "
};
//for creating an Internal Panel in the center panel
private JPanel informationTextFieldPanel = new JPanel();
//for creating an array of JTextField
private JTextField[] informationTextField = new JTextField[10];
//for creating an Internal Panel in the center panel
private JPanel insertInformationButtonPanel = new JPanel();
//for creating a button
private JButton insertInformationButton = new JButton("Insert the Information");
//for creating South Panel
private JPanel southPanel = new JPanel();
//for creating a button
private JButton OKButton = new JButton("Exit");
//create objects from another classes for using them in the ActionListener
private Books book;
//for creating an array of string to store the data
private String[] data;
//for setting availble option to true
private boolean availble = true;
//for checking the information from the text field
public boolean isCorrect() {
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 28 of 111
Page 29 of 111
Page 30 of 111
}
lblShelfNo.setFont(new Font("Tahoma", Font.BOLD, 11));
informationLabelPanel.add(lblShelfNo);
txtShelfNo.setFont(new Font("Tahoma", Font.PLAIN, 11));
informationTextFieldPanel.add(txtShelfNo);
centerPanel.add("East", informationTextFieldPanel);
insertInformationButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
insertInformationButton.setFont(new Font("Tahoma", Font.BOLD, 11));
insertInformationButtonPanel.add(insertInformationButton);
centerPanel.add("South", insertInformationButtonPanel);
cp.add("Center", centerPanel);
southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
OKButton.setFont(new Font("Tahoma", Font.BOLD, 11));
southPanel.add(OKButton);
southPanel.setBorder(BorderFactory.createEtchedBorder());
cp.add("South", southPanel);
insertInformationButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
//for checking if there is a missing information
if (isCorrect()) {
Thread runner = new Thread() {
public void run() {
book = new Books();
//for checking if there is no double information in the database
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 31 of 111
"Edition,Pages,ISBN,NumberOfBooks,NumberOfAvailbleBooks,Library,Availble,ShelfNo)
VALUES "+
" (?,?,?,?,?,?,?,?,?,?,?,?,?)";
Page 32 of 111
ps.setString(4, data[3]);
ps.setInt(5, Integer.parseInt(data[4]));
ps.setInt(6,Integer.parseInt(data[5]));
ps.setInt(7, Integer.parseInt(data[6]));
ps.setString(8, data[7]);
ps.setInt(9, Integer.parseInt(data[8]));
ps.setInt(10, Integer.parseInt(data[8]));
ps.setString(11, data[9]);
ps.setBoolean(12, availble);
ps.setInt(13, Integer.parseInt(txtShelfNo.getText()));
ps.executeUpdate();
}catch(Exception ex){
JOptionPane.showMessageDialog(null, ex.toString());
}
"Edition,Pages,ISBN,NumberOfBooks,NumberOfAvailbleBooks,Library,Availble,ShelfNo)
VALUES ('" +
data[0] + "','" + data[1] + "','" + data[2] + "','" +
data[3] + "', " + data[4] + ", " + data[5] + ", " +
data[6] + ", '" + data[7] + "', " + data[8] + "," + data[8] + ",'" +
data[9] + "', " + availble + ", '" + txtShelfNo.getText() + "')";
book.update(sql);*/
//JOptionPane.showMessageDialog(null, sql);
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 33 of 111
Page 34 of 111
}
}
AddMembers.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class AddMembers extends JInternalFrame {
//for creating the North Panel
private JPanel northPanel = new JPanel();
//for creaing the North Label
private JLabel northLabel = new JLabel("MEMBER INFORMATION");
//for creating the Center Panel
private JPanel centerPanel = new JPanel();
//for creating an Internal Panel in the center panel
private JPanel informationLabelPanel = new JPanel();
//for creating an array of JLabel
private JLabel[] informationLabel = new JLabel[7];
//for creating an array of String
private String[] informaionString = {" Member ID: ", " The Password: ", " Rewrite the
password: ",
" The Name: ", " E-MAIL: ", " Major:", " Expired: "};
//for creating an Internal Panel in the center panel
private JPanel informationTextFieldPanel = new JPanel();
Page 35 of 111
Page 36 of 111
return true;
}
//for checking the information from the text field
public boolean isCorrect() {
data = new String[6];
for (int i = 0; i < informationLabel.length; i++) {
if (i == 0) {
if (!informationTextField[i].getText().equals("")) {
data[i] = informationTextField[i].getText();
}
else
return false;
}
if (i == 1 || i == 2) {
if (informationPasswordField[i - 1].getText().equals(""))
return false;
}
if (i == 3 || i == 4 || i == 5 || i == 6) {
if (!informationTextField[i - 2].getText().equals("")) {
data[i - 1] = informationTextField[i - 2].getText();
}
else
return false;
}
}
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 37 of 111
return true;
}
//for setting the array of JTextField & JPasswordField to null
public void clearTextField() {
for (int i = 0; i < informationLabel.length; i++) {
if (i == 0)
informationTextField[i].setText(null);
if (i == 1 || i == 2)
informationPasswordField[i - 1].setText(null);
if (i == 3 || i == 4 || i == 5 || i == 6)
informationTextField[i - 2].setText(null);
}
}
//constructor of addMembers
public AddMembers() {
//for setting the title for the internal frame
super("Add Members", false, true, false, true);
//for setting the icon
setFrameIcon(new
ImageIcon(ClassLoader.getSystemResource("images/Add16.gif")));
//for getting the graphical user interface components display area
Container cp = getContentPane();
//for setting the layout
northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
//for setting the font
Page 38 of 111
Page 39 of 111
}
if (i == 0) {
informationTextFieldPanel.add(informationTextField[i] = new
JTextField(25));
informationTextField[i].setFont(new Font("Tahoma",
Font.PLAIN, 11));
}
if (i == 3 || i == 4 || i == 5 || i == 6) {
informationTextFieldPanel.add(informationTextField[i - 2] = new
JTextField(25));
informationTextField[i - 2].setFont(new Font("Tahoma",
Font.PLAIN, 11));
}
}
centerPanel.add("East", informationTextFieldPanel);
insertInformationButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
insertInformationButton.setFont(new Font("Tahoma", Font.BOLD, 11));
insertInformationButtonPanel.add(insertInformationButton);
centerPanel.add("South", insertInformationButtonPanel);
cp.add("Center", centerPanel);
southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
OKButton.setFont(new Font("Tahoma", Font.BOLD, 11));
southPanel.add(OKButton);
southPanel.setBorder(BorderFactory.createEtchedBorder());
cp.add("South", southPanel);
insertInformationButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 40 of 111
Page 41 of 111
runner.start();
}
//if the password is wrong
else
JOptionPane.showMessageDialog(null, "the
passowrd is wrong", "Error", JOptionPane.ERROR_MESSAGE);
}
//if there is a missing data, then display Message Dialog
else
JOptionPane.showMessageDialog(null, "Please, complete
the information", "Warning", JOptionPane.WARNING_MESSAGE);
}
});
//for adding the action listener for the button to dispose the frame
OKButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
dispose();
}
});
//for setting the visible to true
setVisible(true);
//show the internal frame
pack();
}
}
Books.java
Prepared by Samiha Antara & Hiba Fathima..Class XII K
//import the packages for using the classes in them into the program
import java.sql.*;
public class Books {
private Connection connection = null;
private Statement statement = null;
private ResultSet resultSet = null;
private int bookID;
private String subject;
private String title;
private String author;
private String publisher;
private int copyright;
private int edition;
private int pages;
private String ISBN;
private int numberOfBooks;
private int numberOfAvailbleBooks;
private int numberOfBorrowedBooks;
private String library;
private boolean availble;
private String URL = "jdbc:mysql://localhost:3306/jlibrary";
public Books() {
}
public int getBookID() {
return bookID;
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 42 of 111
}
public String getSubject() {
return subject;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public String getPublisher() {
return publisher;
}
public int getCopyright() {
return copyright;
}
public int getEdition() {
return edition;
}
public int getPages() {
return pages;
}
public String getISBN() {
return ISBN;
}
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 43 of 111
Page 44 of 111
Page 45 of 111
try {
connection = DriverManager.getConnection(URL,"root","pat123");
statement = connection.createStatement();
resultSet = statement.executeQuery(Query);
while (resultSet.next()) {
bookID = resultSet.getInt(1);
subject = resultSet.getString(2);
title = resultSet.getString(3);
author = resultSet.getString(4);
publisher = resultSet.getString(5);
copyright = resultSet.getInt(6);
edition = resultSet.getInt(7);
pages = resultSet.getInt(8);
ISBN = resultSet.getString(9);
numberOfBooks = resultSet.getInt(10);
numberOfAvailbleBooks = resultSet.getInt(11);
numberOfBorrowedBooks = resultSet.getInt(12);
library = resultSet.getString(13);
availble = resultSet.getBoolean(14);
}
resultSet.close();
statement.close();
connection.close();
}
catch (SQLException SQLe) {
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 46 of 111
System.out.println("Books.java\n" + SQLe.toString());
}
}
public void update(String Query) {
try {
Class.forName("com.mysql.jdbc.Driver");
}
catch (ClassNotFoundException cnfe) {
System.out.println("Books.java\n" + cnfe.toString());
}
catch (Exception e) {
System.out.println("Books.java\n" + e.toString());
}
try {
//connection = DriverManager.getConnection("jdbc:odbc:JLibrary2");
connection = DriverManager.getConnection(URL,"root","pat123");
statement = connection.createStatement();
statement.executeUpdate(Query);
statement.close();
connection.close();
}
catch (SQLException SQLe) {
System.out.println("Books.java\nError:" + SQLe.toString());
}
}
Prepared by Samiha Antara & Hiba Fathima..Class XII K
}
Borrow.java
//import the packages for using the classes in them into the program
import java.sql.*;
public class Borrow {
private Connection connection = null;
private Statement statement = null;
private ResultSet resultSet = null;
private int bookID;
private int memberID;
private Date dayOfBorrowed;
private Date dayOfReturn;
private String URL = "jdbc:mysql://localhost:3306/jlibrary";
public Borrow() {
}
public int getBookID() {
return bookID;
}
public int getMemberID() {
return memberID;
}
public Date getDayOfBorrowed() {
return dayOfBorrowed;
}
public Date getDayOfReturn() {
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 47 of 111
Page 48 of 111
return dayOfReturn;
}
Page 49 of 111
connection.close();
}
catch (SQLException SQLe) {
System.out.println("Borrow.java\n" + SQLe.toString());
}
}
public void update(String Query) {
try {
Class.forName("com.mysql.jdbc.Driver");
}
catch (ClassNotFoundException cnfe) {
System.out.println("Borrow.java\n" + cnfe.toString());
}
catch (Exception e) {
System.out.println("Borrow.java\n" + e.toString());
}
try {
connection = DriverManager.getConnection(URL,"root","pat123");
statement = connection.createStatement();
statement.executeUpdate(Query);
statement.close();
connection.close();
}
catch (SQLException SQLe) {
System.out.println("Borrow.java\n" + SQLe.toString());
Prepared by Samiha Antara & Hiba Fathima..Class XII K
}
}
}
Login.java
import java.awt.EventQueue;
public class login extends javax.swing.JFrame {
public login() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GENBEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jPasswordField1 = new javax.swing.JPasswordField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("LOGIN");
setResizable(false);
jLabel1.setText("USERNAME");
jLabel2.setText("PASSWORD");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Page 50 of 111
Page 51 of 111
jTextField1ActionPerformed(evt);
}
});
jButton1.setText("LOGIN");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(78, 78, 78)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(57, 57, 57)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 52 of 111
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addGroup(layout.createSequentialGroup()
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 53 of 111
.addComponent(jButton1)))
.addContainerGap(81, Short.MAX_VALUE))
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jButton1ActionPerformed
if(jTextField1.getText().equals("admin") && jPasswordField1.getText().equals("admin"))
{
//m =new Main(this);
//m.setVisible(true);
EventQueue.invokeLater(new Main(new JLibrary()));
}
}//GEN-LAST:event_jButton1ActionPerformed
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 54 of 111
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
new login().setVisible(true);
}
Prepared by Samiha Antara & Hiba Fathima..Class XII K
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables
}
Main.java
//import the packages for using the classes in them into the program
import java.awt.EventQueue;
import java.awt.Frame;
import javax.swing.JDialog;
public class Main implements Runnable {
final Frame frame;
public Main(Frame frame) {
this.frame = frame;
}
public void run() {
frame.show();
}
public static void main(String[] args) {
JDialog.setDefaultLookAndFeelDecorated(true);
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 55 of 111
Page 56 of 111
Page 57 of 111
/*public Members(int memberID, int ID, String password, String name, String email,
String major, int numberOfBooks, int mony, Date expired) {
this.memberID = memberID;
this.ID = ID;
this.password = password;
this.name = name;
this.email = email;
this.major = major;
this.numberOfBooks = numberOfBooks;
this.mony = mony;
this.expired = expired;
}*/
public int getMemberID() {
return memberID;
}
Page 58 of 111
Page 59 of 111
}
try {
connection = DriverManager.getConnection(URL,"root","pat123");
statement = connection.createStatement();
resultSet = statement.executeQuery(Query);
while (resultSet.next()) {
memberID = resultSet.getInt(1);
ID = resultSet.getInt(2);
password = resultSet.getString(3);
name = resultSet.getString(4);
email = resultSet.getString(5);
major = resultSet.getString(6);
numberOfBooks = resultSet.getInt(7);
mony = resultSet.getInt(8);
expired = resultSet.getDate(9);
}
resultSet.close();
statement.close();
connection.close();
}
catch (SQLException SQLe) {
System.out.println("Members.java\n" + SQLe.toString());
}
}
Page 60 of 111
import java.awt.*;
public class Splash {
// A simple little method to show a title screen in the
// center of the screen for a given amount of time.
public void showSplash(int duration) {
JWindow splash = new JWindow();
JPanel content = (JPanel) splash.getContentPane();
// set the window's bounds, centering the window
int width = 354;
int height = 268;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
splash.setBounds(x, y, width, height);
// build the splash screen
JLabel label = new JLabel(new
ImageIcon(ClassLoader.getSystemResource("images/splash.JPG")));
JLabel copyrt = new JLabel("", JLabel.CENTER);
copyrt.setFont(new Font("Tahoma", Font.BOLD, 10));
//copyrt.setBorder(BorderFactory.createEtchedBorder());
content.setBackground(Color.LIGHT_GRAY);
//content.setBackground(new Color(232, 232, 228));
content.add(label, BorderLayout.CENTER);
content.add(copyrt, BorderLayout.SOUTH);
content.setBorder(BorderFactory.createLineBorder(Color.BLACK, 2));
Page 61 of 111
Page 62 of 111
// display it
splash.setVisible(true);
// Wait a little while, maybe while loading resources
try {
Thread.sleep(duration);
} catch (Exception e) {
}
splash.setVisible(false);
}
}
Menubar.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.management.JMException;
public class Menubar extends JMenuBar {
//for creating the JMenu for the program
public JMenu fileMenu, bookMenu, memberMenu, searchMenu, loanMenu, reserveMenu,
helpMenu;
//for creating the JMenuItem for JMenu
public JMenuItem printBook, exit, addBook, listBook, listAvailbleBook,
listBorrowedBook;
public JMenuItem editBook, removeBook, bookInformation, addMember, listMember,
editMember;
public JMenuItem removeMember, memberInformation, searchBooksAndMembers,
borrowBook, returnBook;
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 63 of 111
Page 64 of 111
reserveMenu.setMnemonic('r');
helpMenu.setMnemonic('h');
//for setting the image icons
icons = new ImageIcon[12];
for (int i = 0; i < imageName16.length; i++) {
icons[i] = new ImageIcon(ClassLoader.getSystemResource(imageName16[i]));
}
//for adding print books & exit
fileMenu.add(printBook = new JMenuItem("Print Books", icons[0]));
fileMenu.add(exit = new JMenuItem("Exit", icons[1]));
//for adding add, list, listAvailble, listBorrowed, edit & remove Books and book information
to the bookMenu
bookMenu.add(addBook = new JMenuItem("Add Book", icons[2]));
bookMenu.add(listBook = new JMenuItem("List All Books", icons[3]));
bookMenu.add(listAvailbleBook = new JMenuItem("List Availble Books", icons[3]));
bookMenu.add(listBorrowedBook = new JMenuItem("List Borrowed Books", icons[3]));
bookMenu.add(editBook = new JMenuItem("Edit Books", icons[4]));
bookMenu.add(removeBook = new JMenuItem("Remove Book", icons[5]));
//bookMenu.add(bookInformation = new JMenuItem("Book Information", icons[6]));
//for adding add, list, edit & remove Members and member information to the memberMenu
memberMenu.add(addMember = new JMenuItem("Add Member", icons[2]));
memberMenu.add(listMember = new JMenuItem("List All Members", icons[3]));
memberMenu.add(editMember = new JMenuItem("Edit Members", icons[4]));
memberMenu.add(removeMember = new JMenuItem("Remove Member", icons[5]));
memberMenu.add(memberInformation = new JMenuItem("Member Information",
icons[6]));
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 65 of 111
Page 66 of 111
listMember.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I,
ActionEvent.CTRL_MASK));
editMember.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D,
ActionEvent.CTRL_MASK));
removeMember.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
ActionEvent.CTRL_MASK));
borrowBook.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B,
ActionEvent.CTRL_MASK));
returnBook.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
ActionEvent.CTRL_MASK));
listissuedbooks.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X,ActionEvent.CTRL_
MASK));
help.setAccelerator(KeyStroke.getKeyStroke("F1"));
about.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,
ActionEvent.CTRL_MASK));
}
}
PrintBooks.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.*;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.sql.*;
import java.util.StringTokenizer;
import java.util.Vector;
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 67 of 111
Page 68 of 111
System.out.println(ea.toString());
}
catch (Exception e) {
System.out.println(e.toString());
}
try {
connection = DriverManager.getConnection(URL);
statement = connection.createStatement();
resultset = statement.executeQuery(query);
textArea.append("=============== Books Information
===============\n\n");
while (resultset.next()) {
textArea.append("Subject: " + resultset.getString("Subject") + "\n"
+
"Title: " + resultset.getString("Title") + "\n" +
"Author(s): " + resultset.getString("Author") + "\n" +
"Copyright: " + resultset.getString("Copyright") + "\n" +
"Edition: " + resultset.getString("Edition") + "\n" +
"ISBN: " + resultset.getString("ISBN") + "\n" +
"Library: " + resultset.getString("Library") + "\n\n");
}
textArea.append("=============== Books Information
===============");
resultset.close();
statement.close();
connection.close();
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 69 of 111
}
catch (SQLException SQLe) {
System.out.println(SQLe.toString());
}
//for setting the visible to true
setVisible(true);
//to show the frame
pack();
}
public int print(Graphics pg, PageFormat pageFormat, int pageIndex) throws
PrinterException {
pg.translate((int) pageFormat.getImageableX(), (int)
pageFormat.getImageableY());
int wPage = (int) pageFormat.getImageableWidth();
int hPage = (int) pageFormat.getImageableHeight();
pg.setClip(0, 0, wPage, hPage);
pg.setColor(textArea.getBackground());
pg.fillRect(0, 0, wPage, hPage);
pg.setColor(textArea.getForeground());
Font font = textArea.getFont();
pg.setFont(font);
FontMetrics fm = pg.getFontMetrics();
int hLine = fm.getHeight();
if (lines == null)
lines = getLines(fm, wPage);
int numLines = lines.size();
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 70 of 111
Page 71 of 111
if (line.equals("\r"))
continue;
// StringTokenizer will ignore empty lines, so it's a bit tricky to get them...
if (line.equals("\n") && prevToken.equals("\n"))
v.add("");
prevToken = line;
if (line.equals("\n"))
continue;
Page 72 of 111
}
line2 += token;
}
v.add(line2);
}
return v;
}
}
Page 73 of 111
ResultSetTableModel.java
import javax.swing.table.AbstractTableModel;
import java.sql.*;
public class ResultSetTableModel extends AbstractTableModel {
private Connection connection;
private Statement statement;
private ResultSet resultSet;
private ResultSetMetaData metaData;
private int numberOfRows;
// keep track of database connection status
private boolean connectedToDatabase = false;
// initialize resultSet and obtain its meta data object;
// determine number of rows
public ResultSetTableModel(String driver, String url, String query) throws
SQLException, ClassNotFoundException {
Class.forName(driver); // load database driver class
connection = DriverManager.getConnection(url,"root","pat123"); // connect to
database
// create Statement to query database
statement =
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
connectedToDatabase = true; // update database connection status
setQuery(query); // set query and execute it
}
Page 74 of 111
Page 75 of 111
Page 76 of 111
Page 77 of 111
connectedToDatabase = false;
}
}
} // end class ResultSetTableModel
MembersInformation.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
//for creating the North Panel
private JPanel northPanel = new JPanel();
//for creaing the North Label
private JLabel northLabel = new JLabel("MEMBER INFORMATION");
//for creating the Center Panel
private JPanel centerPanel = new JPanel();
//for creating the edit Panel
private JPanel memberIDPanel = new JPanel();
//for creating the edit information Panel
private JPanel memberIDInformationPanel = new JPanel();
//for creating the edit label panel
private JPanel memberIDInformationLabelPanel = new JPanel();
//for creating the edit textField panel
private JPanel memberIDInformationTextFieldPanel = new JPanel();
//for creating the edit button panel
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 78 of 111
Page 79 of 111
Page 80 of 111
return true;
}
//for checking the information from the text field
public boolean isCorrect() {
data = new String[6];
for (int i = 0; i < informationLabel.length; i++) {
if (i == 0) {
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 81 of 111
if (!informationTextField[i].getText().equals("")) {
data[i] = informationTextField[i].getText();
}
else
return false;
}
if (i == 1 || i == 2) {
if (informationPasswordField[i - 1].getText().equals(""))
return false;
}
if (i == 3 || i == 4 || i == 5 || i == 6) {
if (!informationTextField[i - 2].getText().equals("")) {
data[i - 1] = informationTextField[i - 2].getText();
}
else
return false;
}
}
return true;
}
//for checking the information from the text field
public boolean isEditCorrect() {
if (memberIDTextField.getText().equals(""))
return false;
return true;
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 82 of 111
}
//for setting the array of JTextField & JPasswordField to null
public void clearTextField() {
memberIDTextField.setText(null);
for (int i = 0; i < informationLabel.length; i++) {
if (i == 0)
informationTextField[i].setText(null);
if (i == 1 || i == 2)
informationPasswordField[i - 1].setText(null);
if (i == 3 || i == 4 || i == 5 || i == 6)
informationTextField[i - 2].setText(null);
}
}
//constructor of addMembers
public MembersInformation() {
//for setting the title for the internal frame
super("Members Information", false, true, false, true);
//for setting the icon
setFrameIcon(new
ImageIcon(ClassLoader.getSystemResource("images/Information16.gif")));
//for getting the graphical user interface components display area
Container cp = getContentPane();
//for setting the layout
northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
//for setting the font
Page 83 of 111
Page 84 of 111
Page 85 of 111
Page 86 of 111
}
}
informationPanel.add("East", informationTextFieldPanel);
InformationButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
fButton.setFont(new Font("Tahoma", Font.BOLD, 11));
InformationButtonPanel.add(fButton);
informationPanel.add("South", InformationButtonPanel);
centerPanel.add("Center", informationPanel);
cp.add("Center", centerPanel);
southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
exitButton.setFont(new Font("Tahoma", Font.BOLD, 11));
southPanel.add(exitButton);
southPanel.setBorder(BorderFactory.createEtchedBorder());
cp.add("South", southPanel);
//for adding the action listener for the button to dispose the frame
exitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
dispose();
}
});
//for setting the visible to true
setVisible(true);
//show the internal frame
pack();
Prepared by Samiha Antara & Hiba Fathima..Class XII K
}
}
RemoveBooks.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
//for creating the North Panel
private JPanel northPanel = new JPanel();
//for creating the label
private JLabel title = new JLabel("BOOK INFORMATION");
//for creating the Center Panel
private JPanel centerPanel = new JPanel();
//for creating an Internal Panel in the center panel
private JPanel removePanel = new JPanel();
//for creating the label
private JLabel removeLabel = new JLabel(" Write the Book ID: ");
//for creating the text field
private JTextField removeTextField = new JTextField();
//for creating string to store the data
private String data;
//for creating an Internal Panel in the center panel
private JPanel removeMemberPanel = new JPanel();
//for creating the button
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 87 of 111
//constructor of removeBooks
public RemoveBooks() {
//for setting the title for the internal frame
super("Remove Books", false, true, false, true);
//for setting the icon
setFrameIcon(new
ImageIcon(ClassLoader.getSystemResource("images/Delete16.gif")));
//for getting the graphical user interface components display area
Page 88 of 111
Page 89 of 111
Container cp = getContentPane();
//for setting the layout
northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
//for setting the font
title.setFont(new Font("Tahoma", Font.BOLD, 14));
//for adding the label
northPanel.add(title);
//for adding the panel to the container
cp.add("North", northPanel);
//for setting the layout
centerPanel.setLayout(new BorderLayout());
//for setting the layout
removePanel.setLayout(new GridLayout(1, 2, 1, 1));
//for adding the label
removePanel.add(removeLabel);
//for adding the text field
removePanel.add(removeTextField);
//for adding the internal panel to the panel
centerPanel.add("Center", removePanel);
Page 90 of 111
centerPanel.add("South", removeMemberPanel);
//for setting the border
centerPanel.setBorder(BorderFactory.createTitledBorder("Remove a book:"));
//for adding the center panel to the container
cp.add("Center", centerPanel);
removeLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
removeTextField.setFont(new Font("Tahoma", Font.PLAIN, 11));
exitButton.setFont(new Font("Tahoma", Font.BOLD, 11));
removeButton.setFont(new Font("Tahoma", Font.BOLD, 11));
//for setting the layout
southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
//for adding the button
southPanel.add(exitButton);
//for setting the border
southPanel.setBorder(BorderFactory.createEtchedBorder());
//for add the south panel to the container
cp.add("South", southPanel);
removeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
//for checking if there is a missing information
if (isCorrect()) {
Thread runner = new Thread() {
public void run() {
book = new Books();
//for getting the information
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 91 of 111
removeTextField.setText(null);
}
if (numberOfBooks > 1) {
numberOfBooks -= 1;
book.update("UPDATE
Books SET NumberOfBooks =" + numberOfBooks + " WHERE BookID =" + data);
//for setting JTextField to null
removeTextField.setText(null);
}
}
else
Page 92 of 111
runner.start();
}
//if there is a missing data, then display Message Dialog
else {
JOptionPane.showMessageDialog(null, "Please, complete
the information", "Warning", JOptionPane.WARNING_MESSAGE);
}
}
});
//for adding the action listener for the button to dispose the frame
exitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
dispose();
}
});
//for setting the visible to true
setVisible(true);
//show the internal frame
pack();
}
}
RemoveMembers.java
//import the packages for using the classes in them into the program
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
//for creating the North Panel
private JPanel northPanel = new JPanel();
//for creating the label
private JLabel title = new JLabel("MEMBER INFORMATION");
//for creating the Center Panel
private JPanel centerPanel = new JPanel();
//for creating an Internal Panel in the center panel
private JPanel removePanel = new JPanel();
//for creating the label
private JLabel removeLabel = new JLabel(" Write the Member ID: ");
//for creating the text field
private JTextField removeTextField = new JTextField();
//for creating string to store the data
private String data;
//for creating an Internal Panel in the center panel
private JPanel removeMemberPanel = new JPanel();
//for creating the button
private JButton removeButton = new JButton("Remove");
//for creating the South Panel
private JPanel southPanel = new JPanel();
//for adding the button
private JButton exitButton = new JButton("Exit");
//create objects from another classes for using them in the ActionListener
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 93 of 111
//constructor of removeMembers
public RemoveMembers() {
//for setting the title for the internal frame
super("Remove Members", false, true, false, true);
//for setting the icon
setFrameIcon(new
ImageIcon(ClassLoader.getSystemResource("images/Delete16.gif")));
//for getting the graphical user interface components display area
Container cp = getContentPane();
//for setting the layout
northPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
//for setting the font
title.setFont(new Font("Tahoma", Font.BOLD, 14));
//for adding the label
Page 94 of 111
Page 95 of 111
northPanel.add(title);
//for adding the panel to the container
cp.add("North", northPanel);
//for setting the layout
centerPanel.setLayout(new BorderLayout());
//for setting the layout
removePanel.setLayout(new GridLayout(1, 2, 1, 1));
//for adding the label
removePanel.add(removeLabel);
//for adding the text field
removePanel.add(removeTextField);
//for adding the internal panel to the panel
centerPanel.add("Center", removePanel);
//for setting the layout
removeMemberPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
//for adding the button
removeMemberPanel.add(removeButton);
//for addint the internal panel to the center panel
centerPanel.add("South", removeMemberPanel);
//for setting the border
centerPanel.setBorder(BorderFactory.createTitledBorder("Remove a member:"));
//for adding the center panel to the container
cp.add("Center", centerPanel);
removeLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
removeTextField.setFont(new Font("Tahoma", Font.PLAIN, 11));
Prepared by Samiha Antara & Hiba Fathima..Class XII K
Page 96 of 111
Page 97 of 111
removeTextField.setText(null);
}
else
pack();
}
}
Page 98 of 111
Page 99 of 111
Main Window:
Book Information:
List of Books:
Edit Books:
Remove Books:
Add Members:
Members List:
Edit Members:
Search Function:
Borrow Books:
Book Reservation:
5. FUTURE ENHANCEMENTS
Extra and user defined security needs can be employed during request and
Another enhancement would be to add more modules like online library, course
response.
Also, a release of API version is planned so the system can be integrated with other third-
party applications. It will enhance the document management within other applications
6. LIMITATIONS
Number of server machines is assumed to be more with more number of users accessing
the system. But if the user limit exceeds, it can slow down the server system and congest the
network.
7. CONCLUSION
Library Management System leads to a better organizat ion structure since the
information management of the all the available books is well-structured and also leads to better
as well as efficient utilization of resources.
Library Management System can be used by educat ion inst itutes to maintain t he
records of availabilit y of books in the library easily. Achieving this object ive is
difficult using a manual system as the informat ion is scattered, it can be redundant
and collect ing relevant informat ion may be very t ime-consuming. All these
problems are solved using this project.
8.BIBLIOGRAPHY
www.scribd.com
www.google.com
www.wikipedia.com