You are on page 1of 60

A PROJECT REPORT

ON
“LIBRARY MANAGEMENT SYSTEM”
&
“CALCULATOR”
Submitted in partial fulfilment

for the Award of the Degree of

BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING


(Bikaner Technical University)

SESSION (2022 – 2023)

Submitted To: Submitted By:


Mr. Gaurav Gupta Shruti Sen
Assisstant Professor (20EEMCS095)
(Dept Of CSE) B.TECH, V SEM

Department of Computer Science & Engineering


Govt. Mahila Engineering College, Ajmer
Nasirabad Road, Makhupura, Ajmer-(305002)
Calculator

Overview

A calculator is a device that performs arithmetic operations on numbers. Basic calculators can
do only addition, subtraction, multiplication and division mathematical calculations.
Calculators are simply a tool students use to help solve problems. Since they eliminate
tedious computations and algebraic manipulations that discourage many students,
calculators allow more students to solve problems and appreciate the power and value of
mathematics in the world today. The central aim of the project was to test the hypothesis that
providing so-called calculators would improve students' performance in those parts of
the
undergraduate first-year that relied on formal reasoning skills. GUI (Graphical User
Interface) in Java is an easy-to-use visual experience builder for Java applications. It is
mainly made of graphical components like buttons, labels, windows, etc. through which the
user can interact with an application. GUI plays an important role to build easy interfaces for
Java applications. GUI Component classes, such as Button , TextField , and Label . GUI
Container classes, such as Frame and Panel . Layout managers, such as FlowLayout ,
BorderLayout and GridLayout . Custom graphics classes, such as Graphics , Color and Font .
public class mycal extends javax.swing.JFrame {
double num1=0,num2=0;
String operator=null;
public mycal() {
initComponents();
}

@SuppressWarnings("unchecked")
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


t1 = new javax.swing.JTextField();
B7 = new javax.swing.JButton();
B2 = new javax.swing.JButton();
B3 = new javax.swing.JButton();
B4 = new javax.swing.JButton();
B8 = new javax.swing.JButton();
B9 = new javax.swing.JButton();
Bdiv = new javax.swing.JButton();
B5 = new javax.swing.JButton();
Badd = new javax.swing.JButton();
B6 = new javax.swing.JButton();
B1 = new javax.swing.JButton();
Bsub = new javax.swing.JButton();
Bback = new javax.swing.JButton();
Bclear = new javax.swing.JButton();
B0 = new javax.swing.JButton();
Bdot = new javax.swing.JButton();
Bequal = new javax.swing.JButton();
Bmul = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("Algerian", 1, 24)); // NOI18N


jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("CALCULATOR");

t1.setFont(new java.awt.Font("Algerian", 1, 18)); // NOI18N


t1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

B7.setText("7");
B7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B7ActionPerformed(evt);
}
});

B2.setText("2");
B2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B2ActionPerformed(evt);
}
});

B3.setText("3");
B3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B3ActionPerformed(evt);
}
});

B4.setText("4");
B4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B4ActionPerformed(evt);
}
});

B8.setText("8");
B8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B8ActionPerformed(evt);
}
});

B9.setText("9");
B9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B9ActionPerformed(evt);
}
});

Bdiv.setText("/");
Bdiv.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BdivActionPerformed(evt);
}
});

B5.setText("5");
B5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B5ActionPerformed(evt);
}
});

Badd.setText("+");
Badd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BaddActionPerformed(evt);
}
});

B6.setText("6");
B6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B6ActionPerformed(evt);
}
});

B1.setText("1");
B1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B1ActionPerformed(evt);
}
});

Bsub.setText("-");
Bsub.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BsubActionPerformed(evt);
}
});
Bback.setFont(new java.awt.Font("Algerian", 0, 18)); // NOI18N
Bback.setText("BACK");
Bback.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BbackActionPerformed(evt);
}
});

Bclear.setFont(new java.awt.Font("Algerian", 0, 18)); // NOI18N


Bclear.setText("CLEAR");
Bclear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BclearActionPerformed(evt);
}
});

B0.setText("0");
B0.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
B0ActionPerformed(evt);
}
});

Bdot.setText(".");
Bdot.setToolTipText("");
Bdot.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BdotActionPerformed(evt);
}
});
Bequal.setText("=");
Bequal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BequalActionPerformed(evt);
}
});

Bmul.setText("*");
Bmul.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BmulActionPerformed(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()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGroup(layout.createSequentialGroup()
.addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 375,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(19, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.T
RAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(Bback, javax.swing.GroupLayout.PREFERRED_SIZE,
174, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA
TED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Bclear, javax.swing.GroupLayout.PREFERRED_SIZE,
185, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING, false)
.addComponent(B4, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B0, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B7, javax.swing.GroupLayout.PREFERRED_SIZE,
77, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA
TED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.TRAILING, false)
.addComponent(B2, javax.swing.GroupLayout.DEFAULT_SIZE, 72,
Short.MAX_VALUE)
.addComponent(B5, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B8, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Bdot, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(33, 33, 33)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING, false)
.addComponent(B3, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B6, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(Bequal, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(B9, javax.swing.GroupLayout.PREFERRED_SIZE,
69, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.TRAILING, false)
.addComponent(Badd,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)
.addComponent(Bsub,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(Bmul,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(Bdiv, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 44,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(B7, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B8, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B9, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bdiv, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(B4, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B5, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Badd, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B6, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(B1, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B2, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B3, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bsub, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(Bmul, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(B0, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bequal, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bdot, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(Bback, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bclear, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(27, Short.MAX_VALUE))
);

pack();
}

private void B9ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"9");
}

private void B4ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"4");
}

private void BbackActionPerformed(java.awt.event.ActionEvent evt) {


String str =t1.getText();
t1.setText(str.substring(0,str.length()-1));

}
private void B7ActionPerformed(java.awt.event.ActionEvent evt) {
t1.setText(t1.getText()+"7");
}

private void B8ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"8");
}

private void B5ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"5");
}

private void B6ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"6");
}

private void B1ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"1");
}

private void B2ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"2");
}

private void B3ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"3");
}

private void BdotActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+".");
}
private void BdivActionPerformed(java.awt.event.ActionEvent evt) {
num1=Double.parseDouble(t1.getText());
t1.setText("");
operator="/";
}

private void BaddActionPerformed(java.awt.event.ActionEvent evt) {


num1=Double.parseDouble(t1.getText());
t1.setText("");
operator="+";
}

private void BsubActionPerformed(java.awt.event.ActionEvent evt) {


num1=Double.parseDouble(t1.getText());
t1.setText("");
operator="-";
}

private void BmulActionPerformed(java.awt.event.ActionEvent evt) {


num1=Double.parseDouble(t1.getText());
t1.setText("");
operator="*";
}

private void BequalActionPerformed(java.awt.event.ActionEvent evt) {


num2=Double.parseDouble(t1.getText());
double ans=0;
if(operator=="+")
{
ans=num1+num2;
}
if(operator=="-")
{
ans=num1-num2;
}
if(operator=="*")
{
ans=num1*num2;
}if(operator=="/")
{
ans=num1/num2;
}
t1.setText(""+ans);
operator=null;
}

private void BclearActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText("");
}

private void B0ActionPerformed(java.awt.event.ActionEvent evt) {


t1.setText(t1.getText()+"0"); // TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and
feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(mycal.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(mycal.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(mycal.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(mycal.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new mycal().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton B0;
private javax.swing.JButton B1;
private javax.swing.JButton B2;
private javax.swing.JButton B3;
private javax.swing.JButton B4;
private javax.swing.JButton B5;
private javax.swing.JButton B6;
private javax.swing.JButton B7;
private javax.swing.JButton B8;
private javax.swing.JButton B9;
private javax.swing.JButton Badd;
private javax.swing.JButton Bback;
private javax.swing.JButton Bclear;
private javax.swing.JButton Bdiv;
private javax.swing.JButton Bdot;
private javax.swing.JButton Bequal;
private javax.swing.JButton Bmul;
private javax.swing.JButton Bsub;
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField t1;
// End of variables declaration
}
OUTPUT
LIBRARY MANAGEMENT SYSTEM
OVERVIEW

A Library Management System is a system that is used to maintain the records of the
library. It contains work like the number of the available books, the number of books
issued, the number of books to return or renew. It helps to maintain a database that is
useful to enter new books and records of books borrowed by the members with the
respective submission dates. It will reduce the manual work done by the librarian to
maintain the record of the library. It allows maintaining the resources in a more
operative manner that will help to save the time. It is also convenient for the librarian
to manage the process of books allocation. It is useful for students as well as a
librarian to keep the constant track of the availability of all books in a library.
This also includes a login page which provides a higher security so no one can access
the database info without permission.
SOFTWARE REQUIREMENTS:
1. JDK used: Java SE Development Kit 19.0.2

Download link: https://download.oracle.com/java/19/latest/jdk-19_windows-


x64_bin.exe

2. IDE used: NETBEANS

Download link:
https://downloads.apache.org/netbeans/netbeans-installers/16/Apache-
NetBeans-16-bin-windows-x64.exe.asc

3. DATABASE used: MySQL Community


Download link: https://dev.mysql.com/downloads/installer/
4. JAR File used: MySQL-connector-java
Download link: https://dev.mysql.com/downloads/connector/j/
5. Steps for DATABASE CONNECTIVITY:

Then go to Services > Databases (right click)> New connection > Browse sql Driver
Connector JDBC > NEXT > Enter User Name & Password > Next > Finish

Create a database and open main class and write connection provider code in main class.
Now connect this Connection Provider main class with every Java Page.
TABLE OF CONTENTS

1.login.java:
This page allow a user to gain access to an application by entering their username and
password or by authenticating using management system login.
a) Login1.jpeg
b) Login.png
c) Red-x-mark-transparent-background-3.png
2. home.java:
In this page we have six button and each button having different functionality.
a) library_Book_532388_1366x768.jpeg
b) member-add-on-300x300.png
c) New-book.png
d) issue book.png
e) Statistics.png
f) Exit.png
3. newStudent.java:
In this page we have multiple fields to get details of student .
a) 123456.png
b) Red-x-mark-transparent-background-3.png
c) Save-icon—1.png
4. newBook.java:
In this page we have multiple fields to add new book in our database.
a) 123456.png
b) Red-x-mark-transparent-background-3.png
c) Save-icon—1.png
5. IssueBook.java:
In this page is used to store the data of issued books .
a) 123456.png
b) Red-x-mark-transparent-background-3.png
c) Save-icon—1.png
6. ReturnBook.java:
This page is used to store the data of return books and available those books to the students.
a) Search.png
b) 123456.png
c) Red-x-mark-transparent-background-3.png
d) return-icon—1.png
7. Statistics.java:
In this page we can see details of issue books and return books.
a)123456.png
b) Red-x-mark-transparent-background-3.png
login.java

This page allow a user to gain access to an application by entering their username and
password or by authenticating using management system login.
This page connects you with the home page where you can enter or extract the data.

Images added in the page –

Login1.jpeg -used as a background image for login page.


Login.png -used as a background image for login button.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
home.java

This page connects various pages together by using this page you can add a new
student data in the database, you can enter or add the details of new books or the data
of books which are present in the library, you can issue a book to a valid student
whose data exist into the database, you can check the details of the issued books with
the all the required details and if the page is not in need simply loged out from the
page .

Images used in this page-


library_Book_532388_1366x768.jpeg- used as a background image for home page.
member-add-on-300x300.png- used as a background image for button New Student.
New-book.png - used as a background image for button New Book.
issue book.png- used as a background image for button Issue Book.
Statistics.png- used as a background image for button Statistics.
Exit.png -used as a background image for button Logout.
newStudent.java

This page is used to insert the data of new students into the database such as
studentID, Name, FatherName, CourseName and BranchName.

Images used in this page-


123456.png- used as a background image of Frame.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
Save-icon—1.png- used as a background image for save button.
newBook.java

This page is used to insert the Books into the database such as BookID, Name,
Publisher, Price and Publisher Year.

Images used in this page-


123456.png- used as a background image of Frame.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
Save-icon—1.png- used as a background image for save button.
IssueBook.java

This page is used to store the data of issued books ,date of issue, due date and
studentID which issues the book.

Images used in this page-


123456.png- used as a background image of Frame.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
Save-icon—1.png- used as a background image for save button.
ReturnBook.java

This page is used to store the data of return books and available those books to the
students for issue.

Images used in this page-


123456.png- used as a background image of Frame.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
return-icon—1.png- used as a background image for save button.
Search.png- used as background image for search button
Statistics.java

This page is used to show the statistics of return books and issue books.
Images used in this page-
123456.png- used as a background image of Frame.
Red-x-mark-transparent-background-3.png -used as a background image for close
button.
PROJECT(Connection Provider.java)

Used for database connectivity :


Source code
package Project;
import java.sql.*;

public class ConnectionProvider {


public Connection con;
public static Connection getCon()
{
try{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/lms","root","eish@06");
return con;

}
catch(Exception e)
{
System.out.println(e);
return null;
}
}
}
SOURCE CODE
1) login.java

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public loginPage() {
initComponents();
setExtendedState(JFrame.MAXIMIZED_BOTH);
}

private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel1.setText("Username");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(610, 320, 85, 22));

jLabel2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel2.setText("Password");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(610, 370, 80, 22));

jTextField1.setBackground(new java.awt.Color(255, 204, 0));


jTextField1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(710, 320, 229, -1));

jPasswordField1.setBackground(new java.awt.Color(255, 204, 0));


jPasswordField1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jPasswordField1ActionPerformed(evt);
}
});
getContentPane().add(jPasswordField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(710, 370, 229, 30));

jButton1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/login.png"))); // NOI18N
jButton1.setText("Login");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(720, 430, -1, -1));

jButton2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/red-x-
mark-transparent-background-3.png"))); // NOI18N
jButton2.setText("close");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(840, 430, -1, -1));

jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Login
background.PNG"))); // NOI18N
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(-80, 0, 1350, -1));

pack();
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


if(jTextField1.getText().equals("admin")&&
jPasswordField1.getText().equals("admin"))
{
setVisible(false);
new homePage().setVisible(true);
}
else
{
JOptionPane.showMessageDialog(null,"Incorrect Username or Password");
}
}

private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


System.exit(0);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(loginPage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(loginPage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(loginPage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(loginPage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new loginPage().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}
2) home.java

public homePage() {
initComponents();
setExtendedState(MAXIMIZED_BOTH);
}

private void initComponents() {

jLabel2 = new javax.swing.JLabel();


jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();

jLabel2.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Library_Book_532388_1366x768.j
pg"))); // NOI18N

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jButton1.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/member-
add-on-300x300.png"))); // NOI18N
jButton1.setText("New Student");
jButton1.setPreferredSize(new java.awt.Dimension(159, 59));
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(48, 20, 171, -1));

jButton2.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/New
book.png"))); // NOI18N
jButton2.setText("New Book");
jButton2.setPreferredSize(new java.awt.Dimension(159, 59));
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(320, 20, -1, -1));

jButton3.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jButton3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Statics.png"))); // NOI18N
jButton3.setText("Statistics");
jButton3.setPreferredSize(new java.awt.Dimension(159, 59));
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(850, 20, -1, -1));

jButton4.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/issue
book.png"))); // NOI18N
jButton4.setText("Issue Book");
jButton4.setPreferredSize(new java.awt.Dimension(159, 59));
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
getContentPane().add(jButton4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(590, 20, -1, -1));

jButton6.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jButton6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/exit.png"))); // NOI18N
jButton6.setText("Logout");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
getContentPane().add(jButton6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1130, 20, 160, 59));

jLabel1.setFont(new java.awt.Font("Algerian", 0, 12)); // NOI18N


jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Library_Book_532388_1366x768.j
pg"))); // NOI18N
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, -250, 2650, 1270));

pack();
}// </editor-fold>

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
new loginPage().setVisible(true);
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


new newStudent().setVisible(true);
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


new NewBook().setVisible(true);
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {


new IssueBook().setVisible(true);
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


new Statistics().setVisible(true); // TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(homePage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(homePage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(homePage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(homePage.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new homePage().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton6;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration
}
3) newStudent.java

import java.sql.*;
import Project.ConnectionProvider;
import javax.swing.JOptionPane;
public newStudent() {
initComponents();
}

private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox<>();
jComboBox2 = new javax.swing.JComboBox<>();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel1.setText("Student ID");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(179, 92, 98, -1));

jLabel2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel2.setText("Name");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(179, 146, 98, -1));

jLabel3.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel3.setText("Father Name");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(179, 203, 98, -1));

jLabel4.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel4.setText("Course Name");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(179, 256, 98, -1));

jLabel5.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel5.setText("Branch Name");
getContentPane().add(jLabel5, new
org.netbeans.lib.awtextra.AbsoluteConstraints(179, 312, -1, -1));

jTextField1.setBackground(new java.awt.Color(255, 255, 204));


jTextField1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 89, 252, -1));

jTextField2.setBackground(new java.awt.Color(255, 255, 204));


jTextField2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 143, 252, -1));

jTextField3.setBackground(new java.awt.Color(255, 255, 204));


jTextField3.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
getContentPane().add(jTextField3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 200, 252, -1));

jComboBox1.setBackground(new java.awt.Color(255, 255, 204));


jComboBox1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new
String[] { "B.Tech", " " }));
getContentPane().add(jComboBox1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 253, 250, -1));

jComboBox2.setBackground(new java.awt.Color(255, 255, 204));


jComboBox2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new
String[] { "CSE", "IT", "ME", "CE", " " }));
getContentPane().add(jComboBox2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 309, 250, -1));

jButton1.setBackground(new java.awt.Color(255, 255, 204));


jButton1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/save-
icon--1.png"))); // NOI18N
jButton1.setText("Save");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(362, 382, -1, 33));

jButton2.setBackground(new java.awt.Color(255, 255, 204));


jButton2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/red-x-
mark-transparent-background-3.png"))); // NOI18N
jButton2.setText("Close");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(520, 380, -1, 33));

jLabel7.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/123456.png"))); // NOI18N
getContentPane().add(jLabel7, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 700, -1));

pack();
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

String studentID=jTextField1.getText();
String name=jTextField2.getText();
String fatherName=jTextField3.getText();
String courseName=(String)jComboBox1.getSelectedItem();
String branchName=(String)jComboBox2.getSelectedItem();
try
{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
st.executeUpdate("insert into stu
values('"+studentID+"','"+name+"','"+fatherName+"','"+courseName+"','"+branchNa
me+"')");
JOptionPane.showMessageDialog(null,"Successfully Updated");
setVisible(false);
new newStudent().setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Student ID Already Exist");
setVisible(false);
new newStudent().setVisible(true);
}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
}

private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(newStudent.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(newStudent.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(newStudent.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(newStudent.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new newStudent().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JComboBox<String> jComboBox2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
// End of variables declaration
}
4) IssueBook.java

import Project.ConnectionProvider;
import java.sql.Connection;
import java.sql.Statement;
import javax.swing.JOptionPane;
import java.sql.*;
import java.text.SimpleDateFormat;
public class IssueBook extends javax.swing.JFrame {

public IssueBook() {
initComponents();
}

@SuppressWarnings("unchecked")

private void initComponents() {

jLabel5 = new javax.swing.JLabel();


jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jDateChooser1 = new com.toedter.calendar.JDateChooser();
jDateChooser2 = new com.toedter.calendar.JDateChooser();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();

jLabel5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/123456.png"))); // NOI18N
jLabel5.setText("hell");

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setLocation(new java.awt.Point(325, 125));
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel1.setText("book ID");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 96, 106, 30));

jLabel2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel2.setText("STUDENT ID");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 144, 106, 39));

jLabel3.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel3.setText("ISSUE DATE");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 210, 106, 39));

jLabel4.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N


jLabel4.setText("DUE DATE");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 260, 106, 39));

jTextField1.setBackground(new java.awt.Color(255, 255, 204));


jTextField1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(403, 96, 224, 30));

jTextField2.setBackground(new java.awt.Color(255, 255, 204));


jTextField2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(403, 144, 224, 29));

jDateChooser1.setBackground(new java.awt.Color(255, 255, 204));


getContentPane().add(jDateChooser1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(403, 210, 224, 30));

jDateChooser2.setBackground(new java.awt.Color(255, 255, 204));


getContentPane().add(jDateChooser2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(403, 261, 224, 30));

jButton1.setBackground(new java.awt.Color(255, 255, 204));


jButton1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/issue
book.png"))); // NOI18N
jButton1.setText("ISSUE");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(403, 324, 101, 35));

jButton2.setBackground(new java.awt.Color(255, 255, 204));


jButton2.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/red-x-
mark-transparent-background-3.png"))); // NOI18N
jButton2.setText("CLOSE");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(522, 324, 105, 35));

jLabel6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/123456.png"))); // NOI18N
getContentPane().add(jLabel6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(-10, 0, -1, -1));

pack();
}// </editor-fold>

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false); // TODO add your handling code here:
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


SimpleDateFormat dFormat=new SimpleDateFormat("dd-MM-YYYY");
String bookID=jTextField1.getText();
String studentID=jTextField2.getText();
String issueDate=dFormat.format(jDateChooser1.getDate());
String dueDate=dFormat.format(jDateChooser2.getDate());
String returnBook="No";

try
{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select *from book where
bookID='"+bookID+"'");
if(rs.next())
{
ResultSet rs1=st.executeQuery("select *from stu where
studentID='"+studentID+"'");
if(rs1.next())
{
st.executeUpdate("insert into issue
values('"+bookID+"','"+studentID+"','"+issueDate+"','"+dueDate+"','"+returnBook+"')
");
JOptionPane.showConfirmDialog(null,"Book Successfully Issued");
setVisible(false);
new IssueBook().setVisible(true);
}
else
{
JOptionPane.showConfirmDialog(null,"Incorrect StudentID");
}
}
else
{
JOptionPane.showConfirmDialog(null,"Incorrect BookID");
}

}
catch(Exception e)
{
JOptionPane.showConfirmDialog(null,"Connection error");

}
}

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());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(IssueBook.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(IssueBook.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(IssueBook.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(IssueBook.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}

java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new IssueBook().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private com.toedter.calendar.JDateChooser jDateChooser1;
private com.toedter.calendar.JDateChooser jDateChooser2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration
}
5) ReturnBook.java

import java.sql.*;
import Project.ConnectionProvider;
import javax.swing.JOptionPane;
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to
change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this
template
*/

/**
*
* @author HP
*/
public class returnBook extends javax.swing.JFrame {

/**
* Creates new form returnBook
*/
public returnBook() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setLocation(new java.awt.Point(325, 125));
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setBackground(new java.awt.Color(255, 255, 204));


jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel1.setText("Book ID");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(157, 141, 82, -1));

jLabel2.setBackground(new java.awt.Color(255, 255, 204));


jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel2.setText("Student ID");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(157, 198, -1, -1));

jLabel3.setBackground(new java.awt.Color(255, 255, 204));


jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel3.setText("Issue Date");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(157, 256, 102, -1));

jLabel4.setBackground(new java.awt.Color(255, 255, 204));


jLabel4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel4.setText("Due Date");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(157, 318, 102, -1));

jTextField1.setBackground(new java.awt.Color(255, 255, 204));


getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(326, 143, 200, -1));

jTextField2.setBackground(new java.awt.Color(255, 255, 204));


getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(326, 200, 200, -1));

jTextField3.setBackground(new java.awt.Color(255, 255, 204));


jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
getContentPane().add(jTextField3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(326, 258, 200, -1));
jTextField4.setBackground(new java.awt.Color(255, 255, 204));
getContentPane().add(jTextField4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(326, 320, 200, -1));

jButton1.setBackground(new java.awt.Color(255, 255, 204));


jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/search.png"))); // NOI18N
jButton1.setText("Search");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(560, 200, -1, -1));

jButton2.setBackground(new java.awt.Color(255, 255, 204));


jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\HP\\Desktop\\VS\\Icon 1\\
return book png.png")); // NOI18N
jButton2.setText("Return");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(326, 378, -1, -1));

jButton3.setBackground(new java.awt.Color(255, 255, 204));


jButton3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/red-x-mark-
transparent-background-3.png"))); // NOI18N
jButton3.setText("Close");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(436, 378, -1, -1));

jLabel5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/123456.png"))); // NOI18N
jLabel5.setText("jLabel5");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0,
0, -1, -1));

pack();
}// </editor-fold>

private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


String bookID=jTextField1.getText();
String studentID=jTextField2.getText();
try
{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select *from issue where bookID='"+bookID+"'
and studentID='"+studentID+"'");
if(rs.next())
{
jTextField3.setText(rs.getString(3));
jTextField4.setText(rs.getString(4));
jTextField1.setEditable(false);
jTextField2.setEditable(false);

}
else
JOptionPane.showMessageDialog(null," Book is not issued to this student.");
setVisible(false);
new returnBook().setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Student Id already exist");
setVisible(false);
new newStudent().setVisible(true);
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


setVisible(false);
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


String bookID=jTextField1.getText();
String studentID=jTextField2.getText();
try
{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
st.executeUpdate("update issue set returnBook='YES'where
studentID='"+studentID+"'and bookID='"+bookID+"'");
JOptionPane.showMessageDialog(null," Book successfully returned");
setVisible(false);
new returnBook().setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Connection error");
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional)
">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/
plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(returnBook.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(returnBook.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(returnBook.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(returnBook.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new returnBook().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}
6) Statistics.java

import java.sql.*;
import Project.ConnectionProvider;
import javax.swing.JOptionPane;
import net.proteanit.sql.DbUtils;

public class Statistics extends javax.swing.JFrame {

public Statistics() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jLabel2 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setLocation(new java.awt.Point(325, 125));
setUndecorated(true);
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Algerian", 0, 18)); // NOI18N


jLabel1.setText("ISSUE DEtails");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(290, 20, -1, -1));

jTable1.setBackground(new java.awt.Color(255, 255, 204));


jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(jTable1);

getContentPane().add(jScrollPane1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(30, 60, 614, 108));

jLabel2.setFont(new java.awt.Font("Algerian", 0, 18)); // NOI18N


jLabel2.setText("RETURN DETAILS");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(280, 190, -1, 27));

jTable2.setBackground(new java.awt.Color(255, 255, 204));


jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane2.setViewportView(jTable2);

getContentPane().add(jScrollPane2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(30, 230, 614, 116));

jButton1.setBackground(new java.awt.Color(255, 255, 204));


jButton1.setFont(new java.awt.Font("Algerian", 0, 14)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/red-x-
mark-transparent-background-3.png"))); // NOI18N
jButton1.setText("CLOSE");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(540, 380, 97, 32));

jLabel3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/123456.png"))); // NOI18N
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

pack();
}// </editor-fold>

private void formComponentShown(java.awt.event.ComponentEvent evt) {


try
{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select
issue,studentID,student.name,issue.bookID,book.name,issue.issueDate,issue.dueDate
from student inner join book inner join issue where book.bookID=issue.bookID and
student.studentID=issue.studentID and issue.returnBOOK='NO'");
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
ResultSet rs1=st.executeQuery("select
issue,studentID,student.name,issue.bookID,book.name,issue.issueDate,issue.dueDate
from student inner join book inner join issue where book.bookID=issue.bookID and
student.studentID=issue.studentID and issue.returnBOOK='YES'");
jTable2.setModel(DbUtils.resultSetToTableModel(rs1));
}// TODO add your handling code here:
catch(Exception e)
{
JOptionPane.showMessageDialog(null, "Connection error");
}
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false); // TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Statistics.class.getName()).log(java.util.logging.L
evel.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Statistics.class.getName()).log(java.util.logging.L
evel.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Statistics.class.getName()).log(java.util.logging.L
evel.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Statistics.class.getName()).log(java.util.logging.L
evel.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Statistics().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable jTable1;
private javax.swing.JTable jTable2;
// End of variables declaration
}
REFERENCES

1) https://youtu.be/ja_6e6CIyxY

2) https://youtu.be/-nup6K1z4Po

(humne hmara project sbse pehle dikhaya h)

You might also like