0% found this document useful (0 votes)
52 views

Advjava Micro

This document describes a student project to create a Library Book Issue Management System using Java. A group of students will develop a program to help a library manage records of books that have been issued to patrons. The project aims to address course outcomes related to developing GUI programs in Java using AWT and Swing components. It will involve gathering requirements, designing the system, implementing the source code, and testing the output. The document provides background on the programming language Java and outlines an action plan for the project development.

Uploaded by

pranav mahajan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Advjava Micro

This document describes a student project to create a Library Book Issue Management System using Java. A group of students will develop a program to help a library manage records of books that have been issued to patrons. The project aims to address course outcomes related to developing GUI programs in Java using AWT and Swing components. It will involve gathering requirements, designing the system, implementing the source code, and testing the output. The document provides background on the programming language Java and outlines an action plan for the project development.

Uploaded by

pranav mahajan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

SHRIKRISHNA EDUCATIONAL AND CULTURAL

MANDAL’S

SHRI GULABRAO DEOKAR POLYTECHNIC,

Gat no. 26, Mohadishivar, shirsoli road,Jalgaon, Pin: 425002 (M.S)

A Micro Project report on

“Library Book Issue Management System”


Is Submitted as per I scheme Curriculum and the requirement for the

Program: Diploma Third Year in Computer Engineering .

COURSE: Advance Java (22517)

Group Members:

Sr .no Name of members Enrollment number Roll no.


1. MAHAJAN PRANAV SURESH 2005090050 9
2. AKOLE KOMAL AJAY 2005090051 10
3. SURALKAR LILESH DNYANDEO 2005090052 11
4. VAISHNAVI RATHOD 2005090053 12

Guided by:

Mr.Shafique Shaikh

Affiliated to
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MUMBAI.51

Academic year 2022-23

SHRIKRISHNA EDUCATIONAL AND CULTURAL


MANDAL’S

SHRI GULABRAO DEOKAR POLYTECHNIC, JALGAON

DEPARTMENT OF COMPUTER ENGINEERING

CE CERTIFICATE
This is to verify that

Sr.no Name of members Enrollment number Roll no.


1. MAHAJAN PRANAV SURESH 2005090050 9
2. AKOLE KOMAL AJAY 2005090051 10
3. SURALKAR LILESH DNYANDEO 2005090052 11
4. VAISHNAVI RATHOD 2005090053 12

Have successfully presented the entitled microproject on “Library Book Issue


Management System”and submitted in satisfactory manner.

The microproject is submitted in partial fulfillment for the first year diploma in computer
engineering affiliated to Maharashtra state board of technical education ,Mumbai for
academic year 2022-23
INDEX

SR NO. NAME OF THE TOPIC PAGE

PART A- A MICROPROJECT PROPOSAL


1.0 Aims/Benefits of the micro project 4
2.0 Course outcome addressed. 4
3.0 Proposed methodology 4
4.0 Action Plan 5
5.0 Resources used 6

PART-B OUTCOME
1.0 Brief Description 7
2.0 Aim/Benefits of the micro-project 8
3.0 Course Outcome Addressed 8
4.0 Source Code 9 - 24
5.0 Output 25-26
6.0 Conclusion 27
Part A: A micro-project proposal

Library Book Issue Management System

1.0 Aims/Benefits of the micro project

Aim of the project is Library Book Issue Management System. This


project is tend to help for the Library for keeping the record of the
data of books that have been Issued.

2.0 Course outcome addressed.


1. Develop programs using GUI Framework (AWT and Swing).
2. Handle events of AWT and Swings components.
3. Develop programs to handle events in Java Programming.
4. Develop Java programs using networking concepts.
5. Develop programs using database.

3.0Proposed methodology

We have started the project by collecting the essential information about


Library Book Issue Management System. After that we gathered functional and
non-functional requirements then collected information related to hardware
andsoftware requirements . After that we started to implement project.

4.0Action Plan

Sr. Detail of activity Plan start Plan Name of


No. date finish responsible
date team
members
1 Group discussion 15-9-2021 18-9- 1) SHAIKH
2021 LUIZA
2 Searching of real 19-9-2021 21-9- 2) VAISHNAVI
life task 2021 MOTILAL
3 Selection of micro 22-9-2021 23-9- PATIL
project topic 2021 3) SNIGDHA
VIJAY
4 Gathering of 24-9-2021 26-9-
CHAUDHARI
information and 2021
application of it
5 Group discussion 27-9-2021 28-9-
2021
6 Distribution of 29-9-2021 30-9-
work to be done 2021
7 Preparing the 1-10-2021 3-10-
overview of the 2021
project
8 Gathering the 4-10-2021 8-10-
details 2021
9 Preparing rough 9-10-2021 15-10-
analysis of the 2021
project.
10 Study of each 16-10- 29-10-
networking Device. 2021 2021
11 Preparing the 30-10- 2-11-
Configuration/ 2021 2021
Installation Steps.
12 Group discussion 3-11-2021 9-11-
2021
13 Gathering the data 10-11- 20-11-
2021 2021
14 Working on 21-11- 25-11-
connection 2021 2021
diagrams.
15 Finalizing 26-11- 30-11-
diagrams 2021 2021
16 Preparing report 1-12-2021 10-12-
2021
5.0 Resources used

Sr. Name of resource Specifications Quantity


no. material
PC Laptop with 4GB RAM 1
Processor:- Intel Core i3
7020U
2 Operating System Windows 10 Home 1
Single
Language
3 Software

7
PART-B OUTCOME

BOOK SHOP MANAGEMENT SYSTEM

1.0 Brief Description

As we all know library has a vast number of books and to maintain the record of those books it would
be a hilarious work load , in a register ; so we try to do some effective solution for these
problem .with help of java we created an Library Management System for book Issue.
Library Book Issue Management System helps you to manage the such a vast amount of data of books
that has been issued by the peoples and maintain their record of books

Java is a class-based, object-oriented programming language that is designed to have as few


implementation dependencies as possible. It is a general-purpose programming language intended to
let application developers write once, run anywhere (WORA), meaning that compiled Java code can
run on all platforms that support Java without the need for recompilation. Java applications are
typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the
underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer lowlevel
facilities than either of them. The Java runtime provides dynamic capabilities (such as reflection
and runtime code modification) that are typically not available in traditional compiled languages.
Java was originally developed by James Gosling at Sun Microsystems (which has since
been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java
platform. The original and reference implementation Java compilers, virtual machines, and class
libraries were originally released by Sun under proprietary licenses. As of May 2007, in compliance
with the specifications of the Java Community Process, Sun had relicensed most of its Java
technologies under the GNU General Public License. Oracle offers its own HotSpot Java Virtual
Machine, however the official reference implementation is the OpenJDK JVM which is free open
source software and used by most developers and is the default JVM for almost all Linux distributions.

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in
June 1991. Java was originally designed for interactive television, but it was too advanced for the
digital cable television industry at the time. The language was initially called Oak after an oak tree that
stood outside Gosling's office. Later the project went by the name Green and was finally renamed Java,
from Java coffee, the coffee from Indonesia. Gosling designed Java with a C/C++-style syntax that
system and application programmers would find familiar.

8
2.0 Aim/Benefits of the micro-project

Aim of the project is Book Shop Management System. This project is


tend to help for the book shops for recording the data of books.

3.0 Course Outcome Addressed

1. Develop programs using GUI Framework (AWT and Swing).


2. Handle events of AWT and Swings components.
3. Develop programs to handle events in Java Programming.
4. Develop Java programs using networking concepts.
5. Develop programs using database.
6. Develop programs using Servlets.

9
Source Code

package library;

import java.awt.EventQueue;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionListener;

import java.awt.event.ActionEvent;

public class home {

private JFrame frm;

public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {

public void run() {

try { home window = new home();

window.frm.setVisible(true);

} catch (Exception e) {

e.printStackTrace(); } } }); }

public home() {

initialize(); }

private void initialize() {

frm = new JFrame();

frm.setForeground(new Color(129, 0, 129));

frm.setFont(new Font("Times New Roman", Font.BOLD, 12));

frm.setTitle("Saste Library");

frm.setIconImage(Toolkit.getDefaultToolkit().getImage("P:\\dev. Games\\library\\src\\library\\images\\home_icon.jpg"));

frm.setBounds(100, 100, 736, 531);

frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frm.getContentPane().setLayout(null);

JButton btnNewButton = new JButton("Add Book");

10
btnNewButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

Add_book a = new Add_book();

a.setVisible(true); } });

btnNewButton.setOpaque(false);

btnNewButton.setFont(new Font("Times New Roman", Font.BOLD, 11));

btnNewButton.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\book_img.PNG"));

btnNewButton.setForeground(new Color(129, 0, 129));

btnNewButton.setBounds(78, 404, 125, 41);

frm.getContentPane().add(btnNewButton);

JButton btnNewButton_1 = new JButton("Student Login");

btnNewButton_1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

Std_login s = new Std_login();

s.setVisible(true); } });

btnNewButton_1.setOpaque(false);

btnNewButton_1.setFont(new Font("Times New Roman", Font.BOLD, 11));

btnNewButton_1.setForeground(new Color(129, 0, 129));

btnNewButton_1.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\student.png"));

btnNewButton_1.setBounds(314, 404, 149, 41);

frm.getContentPane().add(btnNewButton_1);

JButton btnNewButton_2 = new JButton("Issue");

btnNewButton_2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

Issue i = new Issue();

i.setVisible(true); } });

btnNewButton_2.setOpaque(false);

btnNewButton_2.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\issue.png"));

btnNewButton_2.setForeground(new Color(129, 0, 129));

btnNewButton_2.setFont(new Font("Times New Roman", Font.BOLD, 11));

11
btnNewButton_2.setBounds(560, 404, 115, 41);

frm.getContentPane().add(btnNewButton_2);

JLabel lblNewLabel = new JLabel("Welcome To Saste Library");

lblNewLabel.setForeground(new Color(129, 0, 129));

lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 30));

lblNewLabel.setBounds(361, 136, 359, 48);

frm.getContentPane().add(lblNewLabel);

JLabel lblNewLabel_1 = new JLabel("");

lblNewLabel_1.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\home_img.jpg"));

lblNewLabel_1.setBounds(0, 0, 720, 493);

frm.getContentPane().add(lblNewLabel_1);

//Creating the JFrame for adding new Books

package library;

import java.awt.EventQueue;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionListener;

import java.beans.Statement;

import java.sql.*;

import java.awt.event.ActionEvent;

public class Add_book extends JFrame {

private JPanel contentPane;

private JTextField bki_tf;

private JTextField bkn_tf;

private JTextField bka_tf;

private JTextField bkq_tf;

private JTextField bkm_tf;

public static void main(String[] args) {

12
EventQueue.invokeLater(new Runnable() {

public void run() {

try { Add_book frame = new Add_book();

frame.setVisible(true); }

catch (Exception e) { e.printStackTrace(); } } }); }

public Add_book() {

setIconImage(Toolkit.getDefaultToolkit().getImage("P:\\dev. Games\\library\\src\\library\\images\\New book.png"));

setTitle("Add New Books");

setBounds(100, 100, 508, 457);

contentPane = new JPanel();

contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);

contentPane.setLayout(new BorderLayout(0, 0));

JLabel lblNewLabel = new JLabel("Add New Books");

lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);

lblNewLabel.setForeground(new Color(129, 0, 129));

lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 32));

contentPane.add(lblNewLabel, BorderLayout.NORTH);

JPanel panel = new JPanel();

panel.setForeground(new Color(129, 0, 129));

contentPane.add(panel, BorderLayout.CENTER);

panel.setLayout(null);

JSeparator separator = new JSeparator();

separator.setBounds(0, 0, 482, 13);

panel.add(separator);

JLabel bk_id = new JLabel(" Book Id :");

bk_id.setFont(new Font("Times New Roman", Font.BOLD, 12));

bk_id.setForeground(new Color(129, 0, 129));

bk_id.setBounds(30, 67, 91, 21);

panel.add(bk_id);

13
JLabel bk_nm = new JLabel("Book Name :");

bk_nm.setFont(new Font("Times New Roman", Font.BOLD, 12));

bk_nm.setForeground(new Color(129, 0, 129));

bk_nm.setBounds(30, 114, 91, 21);

panel.add(bk_nm);

JLabel bk_aut = new JLabel("Author :");

bk_aut.setFont(new Font("Times New Roman", Font.BOLD, 12));

bk_aut.setForeground(new Color(129, 0, 129));

bk_aut.setBounds(30, 161, 91, 21);

panel.add(bk_aut);

JLabel bk_quan = new JLabel("Quantity :");

bk_quan.setFont(new Font("Times New Roman", Font.BOLD, 12));

bk_quan.setForeground(new Color(129, 0, 129));

bk_quan.setBounds(30, 208, 60, 21);

panel.add(bk_quan);

JLabel bk_mrp = new JLabel("MRP :");

bk_mrp.setFont(new Font("Times New Roman", Font.BOLD, 12));

bk_mrp.setForeground(new Color(129, 0, 129));

bk_mrp.setBounds(30, 256, 46, 21);

panel.add(bk_mrp);

bki_tf = new JTextField();

bki_tf.setBounds(144, 67, 200, 20);

panel.add(bki_tf);

bki_tf.setColumns(10);

bkn_tf = new JTextField();

bkn_tf.setBounds(144, 114, 200, 20);

panel.add(bkn_tf);

bkn_tf.setColumns(10);

bka_tf = new JTextField();

bka_tf.setBounds(144, 161, 200, 20);

14
panel.add(bka_tf);

bka_tf.setColumns(10);

bkq_tf = new JTextField();

bkq_tf.setBounds(144, 208, 150, 20);

panel.add(bkq_tf);

bkq_tf.setColumns(10);

bkm_tf = new JTextField();

bkm_tf.setBounds(144, 256, 150, 20);

panel.add(bkm_tf);

bkm_tf.setColumns(10);

JButton save = new JButton("Save");

save.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

try{ Class.forName("com.mysql.cj.jdbc.Driver");

System.out.println("Driver is registered");

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3307/library",

"pksa22","2318");

java.sql.Statement stmt = conn.createStatement();

System.out.println("databse connected”);

String sql = "insert into books_record values('" + bki_tf.getText() + "','"+bkn_tf.getText()+"','"+bka_tf.getText()


+"','"+bkq_tf.getText()+"','"+bkm_tf.getText()+"');";

System.out.println(sql);

try

{ stmt.execute(sql);

JOptionPane.showMessageDialog(null,"BOOK IS ADDED");

bki_tf.setText("");

bkn_tf.setText("");

bka_tf.setText("");

bkq_tf.setText("");

bkm_tf.setText("");

}
15
catch(Exception ex)

{ System.out.println(ex); } }

catch(Exception eg)

{ System.out.println(eg); }} });

save.setBackground(Color.ORANGE);

save.setForeground(new Color(129, 0, 129));

save.setFont(new Font("Times New Roman", Font.BOLD, 14));

save.setBounds(144, 320, 89, 23);

panel.add(save);

JButton cancel = new JButton("Cancel");

cancel.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

System.exit(0);

} });

cancel.setBackground(Color.ORANGE);

cancel.setForeground(new Color(129, 0, 129));

cancel.setFont(new Font("Times New Roman", Font.BOLD, 14));

cancel.setBounds(289, 320, 89, 23);

panel.add(cancel);

JLabel lblNewLabel_1 = new JLabel("");

lblNewLabel_1.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\123456.png"));

lblNewLabel_1.setBounds(0, 0, 482, 371);

panel.add(lblNewLabel_1);

} }

// creating JFrame for registration of students

package library;

import java.awt.EventQueue;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionListener;

16
import java.beans.Statement;

import java.sql.*;

import java.awt.event.ActionEvent;

public class Std_login extends JFrame {

private JPanel contentPane;

private JTextField id;

private JTextField name;

private JTextField mob;

public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {

public void run() {

try {

Std_login frame = new Std_login();

frame.setVisible(true);

} catch (Exception e) {

e.printStackTrace();

} } }); }

public Std_login() {

setIconImage(Toolkit.getDefaultToolkit().getImage("P:\\dev. Games\\library\\src\\library\\images\\
student.png"));

setTitle("New Student Registration");

setBounds(100, 100, 476, 419);

contentPane = new JPanel();

contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);

contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("New Student Record");

lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);

lblNewLabel.setForeground(new Color(129, 0, 129));

lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 30));

lblNewLabel.setBounds(0, 11, 460, 35);


17
contentPane.add(lblNewLabel);

JPanel panel = new JPanel();

panel.setBounds(0, 57, 460, 324);

contentPane.add(panel);

panel.setLayout(null);

JSeparator separator = new JSeparator();

separator.setBounds(0, 0, 460, 15);

panel.add(separator);

JLabel lblNewLabel_1 = new JLabel("Student ID :");

lblNewLabel_1.setForeground(new Color(129, 0, 129));

lblNewLabel_1.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_1.setBounds(50, 40, 90, 30);

panel.add(lblNewLabel_1);

JLabel lblNewLabel_2 = new JLabel("Student Name :");

lblNewLabel_2.setForeground(new Color(129, 0, 129));

lblNewLabel_2.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_2.setBounds(40, 80, 100, 30);

panel.add(lblNewLabel_2);

JLabel lblNewLabel_3 = new JLabel("Mobile No. :");

lblNewLabel_3.setForeground(new Color(129, 0, 129));

lblNewLabel_3.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_3.setBounds(50, 120, 90, 30);

panel.add(lblNewLabel_3);

JLabel lblNewLabel_4 = new JLabel("Branch :");

lblNewLabel_4.setForeground(new Color(129, 0, 129));

lblNewLabel_4.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_4.setBounds(64, 161, 76, 30);

panel.add(lblNewLabel_4);

JLabel lblNewLabel_5 = new JLabel("Year :");

lblNewLabel_5.setForeground(new Color(129, 0, 129));

18
lblNewLabel_5.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_5.setBounds(77, 209, 63, 30);

panel.add(lblNewLabel_5);

id = new JTextField();

id.setBounds(150, 45, 200, 20);

panel.add(id);

id.setColumns(10);

name = new JTextField();

name.setBounds(150, 85, 200, 20);

panel.add(name);

name.setColumns(10);

mob = new JTextField();

mob.setBounds(150, 125, 200, 20);

panel.add(mob);

mob.setColumns(10);

JComboBox branch = new JComboBox();

branch.setModel(new DefaultComboBoxModel(new String[] {"Select Branch", "Computer Engg.", "I.T",


"ENTC", "Civil Engg.", "Electrical Engg.", "Mechanical Engg."}));

branch.setBounds(150, 160, 106, 30);

panel.add(branch);

JComboBox year = new JComboBox();

year.setModel(new DefaultComboBoxModel(new String[] {"Select Year", "1st Year", "2nd Year", "3rd Year"}));

year.setBounds(150, 209, 106, 30);

panel.add(year);

JButton save_std = new JButton("Save");

save_std.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

try{ Class.forName("com.mysql.cj.jdbc.Driver");

System.out.println("Driver is registered");

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3307/library","pksa22","2318");

java.sql.Statement stmt = conn.createStatement();


19
System.out.println("databse connected");

String sql = "insert into student_login values('" + id.getText() +

"','"+name.getText()+"','"+mob.getText()+"','"+branch.getSelectedItem()+"','"+year.getSelectedItem()+"');";

System.out.println(sql);

try

stmt.execute(sql);

JOptionPane.showMessageDialog(null,"STUDENT DATA IS INSERTED");

id.setText("");

name.setText("");

mob.setText("");

branch.setSelectedIndex(0);

year.setSelectedIndex(0);

catch(Exception ex)

{ System.out.println(ex); }

catch(Exception ek) { System.out.println(ek); } }

});

save_std.setForeground(new Color(129, 0, 129));

save_std.setBackground(Color.ORANGE);

save_std.setFont(new Font("Times New Roman", Font.BOLD, 12));

save_std.setBounds(150, 274, 89, 23);

panel.add(save_std);

JButton cancel_std = new JButton("Cancel");

cancel_std.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

System.exit(0);}});

cancel_std.setBackground(Color.ORANGE);

cancel_std.setFont(new Font("Times New Roman", Font.BOLD, 12));

20
cancel_std.setForeground(new Color(129, 0, 129));

cancel_std.setBounds(288, 274, 89, 23);

panel.add(cancel_std)

JLabel lblNewLabel_6 = new JLabel("");

lblNewLabel_6.setIcon(newImageIcon("P:\\dev.Games\\library\\src\\library\\images\\123456.png"));

lblNewLabel_6.setBounds(0, 0, 460, 324);

panel.add(lblNewLabel_6);

} }

//creating a JFrame for Issue a book

package library;

import java.awt.EventQueue;

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionListener;

import java.beans.Statement;

import java.sql.*;

import java.util.*;

import java.awt.event.ActionEvent;

public class Issue extends JFrame {

private JPanel contentPane;

private JTextField bid;

private JTextField sid;

private JTextField issue;

private JTextField due;

public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {

public void run() {

try { Issue frame = new Issue();

frame.setVisible(true);

} catch (Exception e) {

21
e.printStackTrace();

} } }); }

public Issue() { setTitle("Book Issue Section");

setIconImage(Toolkit.getDefaultToolkit().getImage("P:\\dev. Games\\library\\src\\library\\images\\issue.png"));

setBounds(100, 100, 434, 400);

contentPane = new JPanel();

contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);

contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("Issue Book");

lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);

lblNewLabel.setBounds(10, 10, 414, 35);

lblNewLabel.setForeground(new Color(129, 0, 129));

lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 30));

contentPane.add(lblNewLabel);

JPanel panel = new JPanel();

panel.setBounds(0, 44, 424, 318);

contentPane.add(panel);

panel.setLayout(null);

JLabel lblNewLabel_1 = new JLabel("Book Id :");

lblNewLabel_1.setForeground(new Color(129, 0, 129));

lblNewLabel_1.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_1.setBounds(40, 40, 100, 30);

panel.add(lblNewLabel_1);

JLabel lblNewLabel_2 = new JLabel("Student Id :");

lblNewLabel_2.setForeground(new Color(129, 0, 129));

lblNewLabel_2.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_2.setBounds(40, 80, 100, 30);

panel.add(lblNewLabel_2);

JLabel lblNewLabel_3 = new JLabel("Issue Date :");

22
lblNewLabel_3.setForeground(new Color(129, 0, 129));

lblNewLabel_3.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_3.setBounds(40, 120, 100, 30);

panel.add(lblNewLabel_3);

JLabel lblNewLabel_4 = new JLabel("Due Date :");

lblNewLabel_4.setForeground(new Color(129, 0, 129));

lblNewLabel_4.setFont(new Font("Times New Roman", Font.BOLD, 12));

lblNewLabel_4.setBounds(40, 160, 100, 30);

panel.add(lblNewLabel_4);

bid = new JTextField();

bid.setBounds(150, 45, 180, 20);

panel.add(bid);

bid.setColumns(10);

sid = new JTextField();

sid.setBounds(150, 85, 180, 20);

panel.add(sid);

sid.setColumns(10);

issue = new JTextField();

issue.setBounds(150, 125, 180, 20);

panel.add(issue);

issue.setColumns(10);

due = new JTextField();

due.setBounds(150, 165, 180, 20);

panel.add(due);

due.setColumns(10);

JButton btnNewButton = new JButton("Issue");

btnNewButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) { String ret="no";

try{

Class.forName("com.mysql.cj.jdbc.Driver");

23
System.out.println("Driver is registered");

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3307/library","pksa22","2318");

java.sql.Statement stmt = conn.createStatement();

System.out.println("databse connected");

ResultSet rs = stmt.executeQuery("select *from books_record where book_id='"+bid.getText()+"'");

if(rs.next()) {

ResultSet rs1 = stmt.executeQuery("select *from student_login where stu_id='"+sid.getText()+"'");

if(rs1.next()) {

String sql="insert into book_issue_record values('" + bid.getText()+"','"+sid.getText()+"','"+issue.getText()+"','"+due.getText()


+"','"+ret+"');";

try

stmt.execute(sql);

JOptionPane.showMessageDialog(null,"BOOK IS ISSUED");

bid.setText("");

sid.setText("");

issue.setText("");

due.setText("");

catch(Exception ex)

{ System.out.println(ex); } }

else{JOptionPane.showMessageDialog(null,"Incorrect Student id");} }

else{JOptionPane.showMessageDialog(null,"Incorrect Book id");}

} catch (ClassNotFoundException ex) {

Logger.getLogger(Issue.class.getName()).log(Level.SEVERE, null, ex);

} catch (SQLException ex) {

Logger.getLogger(Issue.class.getName()).log(Level.SEVERE, null, ex);

} } });

btnNewButton.setBackground(Color.ORANGE);

btnNewButton.setForeground(new Color(129, 0, 129));

btnNewButton.setFont(new Font("Times New Roman", Font.BOLD, 14));


24
btnNewButton.setBounds(150, 227, 89, 23);

panel.add(btnNewButton);

JButton btnNewButton_1 = new JButton("Cancel");

btnNewButton_1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

System.exit(0); } });

btnNewButton_1.setBackground(Color.ORANGE);

btnNewButton_1.setForeground(new Color(129, 0, 129));

btnNewButton_1.setFont(new Font("Times New Roman", Font.BOLD, 14));

btnNewButton_1.setBounds(281, 227, 89, 23);

panel.add(btnNewButton_1);

JLabel lblNewLabel_5 = new JLabel("");

lblNewLabel_5.setIcon(new ImageIcon("P:\\dev. Games\\library\\src\\library\\images\\123456.png"));

lblNewLabel_5.setBounds(0, 0, 414, 318);

panel.add(lblNewLabel_5);

JSeparator separator = new JSeparator();

separator.setBounds(0, 56, 424, 11);

contentPane.add(separator);

OutPut
25
26
27
Conclusion:

Java is an object-oriented programming language. It is a general-


purpose programming language, mainly designed to run developed
java code on all platforms that support Java without recompilation.
As we all know, Java is one of the most popular and in-demand
programming languages to learn and it was one of the first languages to
standardise high-level threading utilities.
Java project is a must for aspiring developers. This project helps
developers develop real-world projects to hone their skills and materialise
their theoretical knowledge into practical experience. Java has significant
advantages both as a commercial language and also as a teaching language.
Java project provides rigorous compile-time error checking typically
associated with Pascal, allowing instructors to introduce students to GUI
programming, networking, threads, and other important concepts used in
modern-day software. Overall, the java project gives a complete design for
the extended language.
And thus with the help of this absolute interesting and GUI features we
made an useful project that will made the librarians stressfree for
maintaining the super work load of book that has been issued

28

You might also like