Top Banner
8/7/2019 library_managment http://slidepdf.com/reader/full/librarymanagment 1/40 LIBRARY MANAGEMENT SYSTEM A PROJECT REPORT In partial fulfillment for the award of the degree of Bachelor of Technology IN Computer Sc. Engineering Submitted by Jyoti Swami , Anamika Choudhary & Pankaj Grover Submitted to Department of Computer Sc. Engineering Engineering College Bikaner (An Autonomous Institute of Govt. of Rajasthan) 
40

library_managment

Apr 08, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 1/40

LIBRARY MANAGEMENT SYSTEM

A PROJECT REPORT

In partial fulfillment for the award of the degree of 

Bachelor of Technology 

IN

Computer Sc. Engineering

Submitted by

Jyoti Swami , Anamika Choudhary 

& Pankaj Grover

Submitted to

Department of Computer Sc. Engineering

Engineering College Bikaner(An Autonomous Institute of Govt. of Rajasthan) 

Page 2: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 2/40

Certificate

Certified that this project entitled “LIBRARY MANAGEMENT

SYSTEM” submitted by Jyoti Swami, Anamika Choudhary & Pankaj Grover

students of Computer Sc. Engineering Department, Engineering College

Bikaner, in the partial fulfillment of the requirement for the award of 

Bachelor of Technology. (Computer Sc. Engineering) Degree of RTU, Kota,

is a record of students own study carried under my supervision & guidance.

This report has not been submitted to any other university or institution for 

the award of any degree.

  Mr. N. S. Shekhawat

Project Incharge

Mr. Narpat Singh ShekhawatH.O.D. Comp. Sc. Engineering

12

Page 3: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 3/40

Acknowledgement

We express our sincere thanks to our project incharge, Mr. Narpat Singh Shekhawat,

H.O.D., Computer Sc. Deptt., for guiding us right from the inception till the successful

completion of the project. We sincerely acknowledge him/them for extending their 

valuable guidance, support for literature, critical reviews of project and the report and

above all the moral support they had provided us with all stages of this project.

We would also like to thanks our lab technicians Computer Sc. Deptt., for their 

help and cooperation throughout our project.

Jyoti Swami

Anamika Choudhary 

Pankaj Grover

Abstract

12

Page 4: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 4/40

Title of Project: - ADDRESS BOOK 

Library management System is an Desktop Application which manages Bookst

details such as No. of Books ,No. of Members and Search any book and Member by

individual ly. Now the Database Handling is easy and it is an automated system that can

manage all the work. Library Mangement System Avoids a problem of manual

addition/editation and Searching any book or Member, It reduces together in

scheduling and optimizing manpower and resources.

Library Management System will fully optimize resources as Librarion allocates

them. For all this user only need to enter some piece of basic data which includes

information regarding Book details of users or for adding any new member etc.

According to data, System Generates Records of Books and persons, further if user wants

Hard Copy of it, user can print it.

Features of Library Management System :-

• SearchBook/MemberRetrieves a subset of the Library Management System given a search

criteria. In absence of search criteria this method retrieves the completebooks/Members.

• EditBook/MemberRetrieves the book which want to edit and member info also can be altered.

• AddBooks/MembersAdds new books to the Library and can add new members /students in the

library

12

Page 5: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 5/40

ContentsContents

Objective and scope of the report........................................................6Objective and scope of the report........................................................6

Methodology…………………………………....................................7Methodology…………………………………....................................7

Performance Proposed System...........................................................15Performance Proposed System...........................................................15

Feasibility analysis.............................................................................16Feasibility analysis.............................................................................16

IntroductionIntroduction

Chapter 1) Introduction............................................................17Chapter 1) Introduction............................................................17

1.1) Introduction to JDK1.6.0..............................181.1) Introduction to JDK1.6.0..............................18

1.2) Introduction MS Acces……………......................221.2) Introduction MS Acces……………......................22

Chapter 2) System Analysis....................................................25Chapter 2) System Analysis....................................................25

Chapter 3) Design of the project.............................................26Chapter 3) Design of the project.............................................26

Conclusion and Future work ............................................................31Conclusion and Future work ............................................................31

Bibliography / Reference .................................................................22Bibliography / Reference .................................................................22

12

Page 6: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 6/40

OBJECTIVE AND SCOPE OF THE REPORTOBJECTIVE AND SCOPE OF THE REPORT

Objective

The main objectives of this project are as follow: -

1. Accuracy: - The level of accuracy in the proposed system will be higher.

All operations would be done correctly and it ensures that whatever information is coming from the User is accurate.

2. Easily updating of records: - Any Updating in the existingrecords(Books/members)can be done easily, without affecting other 

related records.

3. Reliability: - The reliability of the proposed system will be high due to

the above stated reasons. The reason for the increased reliability of the

system is that now there would be proper storage of information.

4. No Redundancy: - In the proposed system utmost care would be that

information is not repeated anywhere, in storage or otherwise. This would

assure economic use of storage space and consistency in the data stored.

5. Immediate retrieval of information: - The main objective of 

proposed system is to provide for a quick and efficient making of Students

records. Any type of information would be available whenever the

Librarion requires.

12

Page 7: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 7/40

METHODOLOGYMETHODOLOGY

Software Development Life Cycle (SDLC) is a structured sequence of phases

for implementing an information system.

In the software development process we focus on the activities

directly related to the production of the software, for example, design, coding, and

testing. A development process is a sequence of steps. Each step performs a well-

defined activity leading towards the satisfaction of the project goals, with the

output of one step forming the input of the next one.

We have followed the concept of SDLC in the following way:

SURVEY

FEASIBILITY STUDY

ANALYSIS

PRELIMINARY DESIGN

SYSTEM DESIGN

IMPLEMENTATION

ACCEPTANCE TEST GENERATION

QUALITY ASSURANCE

DATABASE CONVERSION INSTALLATION

SURVEY

12

Page 8: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 8/40

It begins with a request from the user for a new system. It involves the

following:

Identify the requirement for the system.

Clarify deficiencies in the current system.

Identify deficiencies in the current system.

Establish goals and objectives for the new system.

Determine the feasibility for the new system.

Prepare a project charter that will be used to guide thereminder of the project.

FEASIBILITY STUDY

Depending on the results of the initial investigation, the survey is

expanded to a more detailed feasibility study.

Formation of a project form and appointment of a project leader.

Preparation of System flow charts.

Enumerate proposed candidate system.

Describe the characteristics of that candidate system.

Determine and evaluate the performance of that candidate system.

Weight system performance and cost data. Selection of the best candidate system.

 

ANALYSIS

Analysis is a detailed study of the various operations performed by a

system and their relationships within and outside of the system. This

activity is also used to study the system in details. The objective of this

step is to develop structured system specification for the proposed system.The structured system specification will be called the Essential Model. It

involves:

Detailed study of the system.

Understand the procedure of the system.

12

Page 9: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 9/40

Determine the scope of the system.

Define the goals of the proposed system.

12

Page 10: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 10/40

PRELIMINARY DESIGN

The most creative and challenging phase of the system life cycle is

System Design. The term design describes the final system and the

process by which it is developed. This activity deals with certain design

issues that are to be finalized in consultation with the user. The two most

important issues of relevance to the user are the automation boundary &

the human machine interface. The output of this activity is the user 

implementation model. This model, in addition to the essential model

defines the following for the system:

Automation Boundary

Report Layout

Workable plan for implementing the candidate system.

Screen layouts for the data entry forms

Menus

Information on personnel, money, hardware, facilities, and

their estimated cost must also be available.

DESIGN

System design involves the transformation of the user implementation

model into software design. The first step is to determine how the output

is to be produced and in what format. Second, input data and master files

(database) have to be designed to meet the requirements of the proposed

output.

The design specification of the proposed system consists of the

following:

Database schema

Pseudo code for all the modules.

12

Page 11: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 11/40

IMPLEMENTATION

The implementation phase is less creative then system design. This

activity includes programming, testing & integration of modules

into progressively more complete system.

It is primarily concerned with user training, site preparation, and

file conversion. During the final testing user acceptance is tested,

followed by user training.

System testing checks the readiness and accuracy of the system to

access, updates, and retrieve data from new files. The output of thisactivity is the complete integrated system.

Major sub activities

Coding

Integration

Testing

Debugging

Inputs Project character 

Design specification

Outputs

Integrated system

12

Page 12: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 12/40

ACCEPTENCE TEST GENERATION

This activity generates a set of test data that can be used to test the new

system before accepting it. If successful, the program(s) is then run with

“live” data. Otherwise a diagnostic procedure is used to locate and

correct errors in the program.

Input

Project character 

Output

Quality assurance test set

 

PROCEDURE DESCRIPTION

The objective of this step is to produce a manual, which may be used as

a guide for operating the system.

Inputs

Project character 

User implementation model

Outputs User manual (guide for end user)

12

Page 13: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 13/40

INSTALLATION

This is another activity of the System Development Life Cycle. The

change over from the current system to the new system is done.

Inputs

Project character 

User manual

Outputs

This project involves all the activities of the System Development Life

Cycle except for the database conversion & installation.

Performance of Proposed SystemPerformance of Proposed System

The proposed system is intended to be user-friendly, fast & automated, easy to

maintain & use and would require minimal knowledge of working with

computers.

The interface of the proposed system is easy to understand. It uses different forms

for different type of information. It can also be used to store the details of 

Customer so that any further contacts can be done for any purpose. The system

can generate a new Reports with the previous database, so that a user don’t have

to enter the database again & again for the same database.

12

Page 14: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 14/40

Feasibility AnalysisFeasibility Analysis

The objective of the feasibility study is not to solve the problem but to

acquire a sense of its scope. During the study, the problem definition is

crystallized and aspects of the problem to be included in the system are

determined. Consequently, costs and benefits are estimated with greater accuracy

at this stage.

The result of the feasibility study is a formal proposal. This is simply a

report- a formal document detailing the nature and scope of the proposed solution.

This is the most crucial decision point, many projects die here, where the

most promising ones continue through implementation.

The following are the type of feasibility studies: -

1. Operational Feasibility: -

To find this we require that the proposed system can fit in the

existing system & should be able to satisfy the requirements of the end

users. The system has been made user interactive so that it would bevery easy for a computer literate staff.

2. Economic Feasibility: -

Economic analysis the most frequently method for evaluating the

effectiveness of a candidate system. Cost /benefit analysis is the main

measurement by which economic feasibility is measured. The

proposed system is economically feasible as the new system could be

easily run on the hardware that the organization is currently having.

And only the cost of developing the system has to be incurred in the

beginning.

The system would definitely prove to be very economical in the long

run.

12

Page 15: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 15/40

3. Technical Feasibility: -

This involves financial considerations to accommodate technical

enhancements. In other words technical feasibility, centers on the

existing computer system (hardware, software etc.). And to what

extent it can support the proposed additions. Thus technically this

project is feasible because there was no so budget problem.

4. Time Feasibility: -

It addresses the time it will take to complete the project i.e. the system

should be developed within a reasonable time.

12

Page 16: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 16/40

TOOLS

&

TECHNOLOGIES

12

Page 17: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 17/40

  INTRODUCTION TO JDK1.6.0INTRODUCTION TO JDK1.6.0

IntroductionIntroduction To JDK1.6.0To JDK1.6.0What is Java?

Java is a programming language originally developed by James Gosling at Sun

Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as

a core component of Sun Microsystems' Java platform. The language derives much of itssyntax from C and C++ but has a simpler object model and fewer low-level facilities.

Java applications are typically compiled to bytecode (class file) that can run on any Java

Virtual Machine (JVM) regardless of  computer architecture. Java is general-purpose,

concurrent, class-based, and object-oriented, and is specifically designed to have as few

implementation dependencies as possible. It is intended to let application developers"write once, run anywhere". Java is considered by many as one of the most influential

programming languages of the 20th century, and is widely used from applicationsoftware to web applications

The original and reference implementation Java compilers, virtual machines, and class

libraries were developed by Sun from 1995. As of May 2007, in compliance with the

specifications of the Java Community Process, Sun relicensed most of their Javatechnologies under the GNU General Public License. Others have also developed

alternative implementations of these Sun technologies, such as the GNU Compiler for 

Java and GNU Classpath.

12

Page 18: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 18/40

MYSQLMYSQL

Introduction to MySql Introduction to MySql 

The installation instructions were scrutinized, the latest distribution was downloaded,

coffee was brewed and drank and brewed again. The familiar  configure, make and makeinstall  were wielded to once again produce another beautifully compiled application.

Nods were exchanged, pats on the back traded, frothy capuccino toasts are proposed insuccession. Yes, there is reason to celebrate in the office today, as the MySQL database

server has been successfully installed.

You lounge back in your deskchair, surrounded by colleagues hailing the wisdom of you,the newly-christened MySQL administrator. If they only knew the pain and anguish

swirling around in your mind right now, as you ponder the question, "So now what?".

The purpose of this tutorial is to acquaint new MySQL users with several of the key

aspects of this wonderful database server. Issues regarding general server functionality,security, user and privilege administration, working with databases and tables, and data

backups will all be introduced to some degree. While the reader will likely find much of 

this material easy to understand, keep in mind that these concepts lay much of the

foundation for efficiently and properly working with the MySQL database server, inaddition to implementing more complicated aspects which will be discussed in later 

tutorials. Therefore it is suggested that the reader take the time to not only read the

tutorial, but also to actually follow along with the steps described herein, experimenting

12

Page 19: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 19/40

with his own MySQL installation.

• The MySQL Configuration File: my.cnf 

It's very likely that the first task the administrator will want to undertake is proper 

configuration of MySQL's configuration file. This file, entitled my.cnf , stores defaultstartup options for both the server and for clients. Correct configuration of this file can go

a long way towards optimizing MySQL, as various memory buffer settings and other 

valuable options can be set here.

Interestingly, the scope of this file can be set according to its location. The settings willbe considered global to all MySQL servers if stored in /etc/my.cnf . It will be global to a

specific server if located in the directory where the MySQL databases are stored

(/usr/local/mysql/data for a binary installation, or /usr/local/var for a source installation).Finally, its scope could be limited to a specific user if located in the home directory of the

MySQL user (~/.my.cnf ). Keep in mind that even if MySQL does locate a my.cnf file

in /etc/my.cnf (global to all MySQL servers on that machine), it will continue its search

for a server-specific file, and then a user-specific file. You can think of the finalconfiguration settings as being the result of the /etc/my.cnf, mysql-data-dir/my.cnf, and

~/.my.cnf files.

In order to aid administrator's in the proper configuration of this file, the MySQLdevelopers have included four sample my.cnf  files within the distribution. Their names

are my-huge.cnf.sh, my-large.cnf.sh, my-medium.cnf.sh, and my-small.cnf.sh, and each

denotes recommended configuration settings in accordance with system resourceavailability

Keywords:-

Software Interfaces

Following software are required for developing Windows based application:-

I. Operating System Windows Xp Sp2 or Higher

II. Environment Dreamnweaver

III. Frontend Tool JDK1.6.0

IV. Technology java

12

Page 20: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 20/40

V. Backend Tool MSAccess

VI. Data Access Tool MSAccess

VII. Reports Crystal Report.

Hardware Interfaces

It's a Windows– based project, so a robust hardware configuration is required. The

hardware requirements are:

I. Processor P IV 1.8 GHz and above.

I

I.

Motherboard Intel 845 and above

I

I

I.

RAM 768 MB and above

I

V

.

Hard Disk 5 GB for Visual Studio .NET

V

.

I/O Devices Keyboard, mouse and Color

monitor

Project type keywords

Analysis, Design, Implementation, Testing, User Interface

12

Page 21: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 21/40

Generic Technology keywords

Databases with MSAccess and Programming with JAVA.

Steps to start-off the project

The suggested OS and languages to implement such a system are

Microsoft platform: The system is developed using JDK1.6.0 and MSAccesss as the back 

end.

Manpower requirements3 to 4 students can complete this project in 10-15 days if they work fulltime on it.

Snap Shots

Library Management System

12

Page 22: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 22/40

12

Page 23: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 23/40

12

Page 24: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 24/40

12

Page 25: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 25/40

12

Page 26: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 26/40

Source Code 

Login.java

import java.util.*;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.event.*;

import java .io.*;

import javax.swing.border.*;

import javax.swing.border.Border;

import javax.swing.border.TitledBorder;

interface Constants {

String path = "C:/My_Java/";

}

class Login extends JPanel implements ActionListener,Constants

{

JTextField field;

public Login(JFrame frm)

{

JMenuBar bar = new JMenuBar();

frm.setJMenuBar(bar);

}

12

Page 27: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 27/40

public void actionPerformed(ActionEvent e)

{

String cmd;

cmd = e.getActionCommand();

if(cmd.equals("Sign In..."))

{

new a();

}

}

private static void addComponent(Container container,Component c,int x,int y,int

width,int height)

{

c.setBounds(x,y,width,height);

container.add(c);

}

public Dimension getPreferredSize()

{

return new Dimension(800,700);

}

public static void main(String args[])

12

Page 28: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 28/40

{

//JFrame.setDefaultLookAndFeelDecorated(true);

//JDialog.setDefaultLookAndFeelDecorated(true);

JFrame frame = new JFrame("LOGIN FORM");

Login panel = new Login(frame);

frame.setLocation(new Point(300,15));

//Creation of Login picture & Sign In Button

ImageIcon icon = new ImageIcon("images/ecb.gif");

JLabel j1 = new JLabel("", icon, JLabel.CENTER);

frame.setForeground(Color.black);

frame.setBackground(Color.lightGray);

JButton button = new JButton();

button.setBackground(new Color(168, 245, 5));

button.setFocusPainted(false);

button.setHorizontalAlignment(SwingConstants.CENTER);

button.setHorizontalTextPosition(SwingConstants.CENTER);

// button.setIcon(new ImageIcon(path+"banner1.gif"));

button.setText("Sign In..");

button.addActionListener(new B1());

//button.setVisible(false);

addComponent(panel, button, 58,250,100,200);

//Button work complete

panel.add(j1,"Center");

frame.addWindowListener(new WindowCloser());

frame.getContentPane().add(panel,"Center");

12

Page 29: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 29/40

frame.setSize(panel.getPreferredSize());

frame.setResizable(false);

frame.setVisible(true);

//frame.setEnabled(false);

///////////////Login form/////////////

new a();

//////////////////////////////////////////

}

}

class WindowCloser extends WindowAdapter 

{

public JFrame frame;

public void windowClosing(WindowEvent e)

{

int r;

r = JOptionPane.showConfirmDialog(frame,"Are you sure! You Want to

Exit","Exit ",JOptionPane.YES_NO_CANCEL_OPTION);

switch(r)

{

case JOptionPane.YES_OPTION:

System.exit(0);

break;

case JOptionPane.NO_OPTION:

frame.dispose();

12

Page 30: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 30/40

break;

case JOptionPane.CANCEL_OPTION:

frame.dispose();

break;

case JOptionPane.CLOSED_OPTION:

frame.dispose();

break;

}

//frame.setLocation(new Point(300,190));

}

}

class B1 implements ActionListener 

{

public void actionPerformed(ActionEvent e)

{

new a();

}

}

 

//////////////////////////////

12

Page 31: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 31/40

Page 32: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 32/40

contentPane = (JPanel)this.getContentPane();

jPanel = new JPanel();

userId.setText(" User Id");

pwd.setText(" password");

textbox1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{

textbox1_actionPerformed(e);

}

});

textbox2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{

textbox2_actionPerformed(e);

}

});

Button1.setText("Sign In");

Button1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{

Button1_actionPerformed(e);

}

12

Page 33: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 33/40

});

Button2.setText("Cancel");

Button2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

{

Button2_actionPerformed(e);

}

});

contentPane.setLayout(null);

addComponent(contentPane, userId, 27,57,49,18);

addComponent(contentPane, pwd, 32,92,60,18);

addComponent(contentPane, textbox1, 94,57,121,23);

addComponent(contentPane, textbox2, 96,90,121,22);

addComponent(contentPane, Button1, 23,187,83,28);

addComponent(contentPane, Button2, 144,187,83,28);

addComponent(contentPane, jPanel, 17,18,222,143);

jPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

jPanel.setBorder(new TitledBorder("Enter your User Id"));

this.setTitle("Sign In");

this.setResizable(false);

//this.setEnabled(true);

//this.requestFocus();

//this.setVisible(false);

//this.pack();

12

Page 34: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 34/40

this.setLocation(new Point(290,190));

this.setSize(new Dimension(256, 263));

//this.addWindowListener(new WindowCloser());

this.addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent we)

{

//System.exit(0);

}

});

}

public void addComponent(Container container,Component c,int x,int y,int

width,int height)

{

c.setBounds(x,y,width,height);

container.add(c);

}

public void textbox1_actionPerformed(ActionEvent e)

{

//dispose();

}

12

Page 35: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 35/40

public void textbox2_actionPerformed(ActionEvent e)

{

String output1 = textbox1.getText();

dispose();

contentPane.setLocation(new Point(310,250));

int min = 0;

int max = 150;

String[] message = new String[2];

message[0] = "Connecting.....";

message[1] = output1 ;

final ProgressMonitor monitor = new

ProgressMonitor(contentPane,message,"",min,max);

final Runnable runnable = new Runnable()

{

public void run()

{

int sleepTime = 50;

for(int i=1;i<150;i++)

{

try

{

monitor.setProgress(i);

if(monitor.isCanceled())

{

monitor.setProgress(100);

12

Page 36: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 36/40

break;

}

Thread.sleep(sleepTime);

}

catch(InterruptedException dontcare)

{}

}

monitor.close();//System.exit(0);

JDialog fram = new JDialog();

fram.setLocation(new Point(300,15));

fram.setResizable(false);

fram.addWindowListener(new WindowCloser());

fram.setContentPane(new JLibrary());

fram.pack();

fram.setVisible(true);

fram.setTitle("LIBRARY");

}

};

Thread thread = new Thread(runnable);

thread.start();

}

public void Button1_actionPerformed(ActionEvent e)

{ String output1,output2;

output1 = textbox1.getText();

12

Page 37: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 37/40

Page 38: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 38/40

try

{

monitor.setProgress(i);

if(monitor.isCanceled())

{

monitor.setProgress(100);

break;

}

Thread.sleep(sleepTime);

}

catch(InterruptedException dontcare)

{}

}

monitor.close();//System.exit(0);

JDialog fram = new JDialog();

fram.setLocation(new Point(300,15));

fram.setResizable(false);

fram.addWindowListener(new

WindowCloser());

fram.setContentPane(new JLibrary());

fram.pack();

fram.setVisible(true);

fram.setTitle("");

}

};

12

Page 39: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 39/40

Thread thread = new Thread(runnable);

thread.start();

}

}

public void Button2_actionPerformed(ActionEvent e)

{

dispose();

}

class WindowCloser extends WindowAdapter 

{

public JFrame frame;

public void windowClosing(WindowEvent e)

{

int r;

r = JOptionPane.showConfirmDialog(frame,"Are you sure! You Want to

Exit","Exit ",JOptionPane.YES_NO_CANCEL_OPTION);

switch(r)

{

case JOptionPane.YES_OPTION:

System.exit(0);

break;

case JOptionPane.NO_OPTION:

frame.dispose();

12

Page 40: library_managment

8/7/2019 library_managment

http://slidepdf.com/reader/full/librarymanagment 40/40

break;

case JOptionPane.CANCEL_OPTION:

frame.dispose();

break;

case JOptionPane.CLOSED_OPTION:

frame.dispose();

break;

}

}

}

}

/////////////////////////////