Sei sulla pagina 1di 289

A PROJECT REPORT ON

Submitted By:

Submitted To:

Shubham Barnwal

Res. Sanjeev Sharma


Sir

Sunil Krishna Saxena


Shivam Rastogi
Prashant Gangwar

Abstarc
This project has the many features which are useful for the payroll management
purpose. In this software the user can store the information of the personnels,
store the information of distribution of salaries, manage accounts of the
personnel, store information of tax payed by the personnels.
The Project is an endeavor to improve efficiency in the process of registration
time duration. How schema the allot and how much the time direction.

The above mentioned process till date is totally manual leaching to transaction
processing system has resulted in reasonable solution to current problem.

The after I Modified versions Modules, considering. The various validation checks
and security measures. Which are prerequisite of on-line system. It is apparent the
besides in traducing efficient customer management, improved accuracy access to
customer status etc. the new system relieve the concerned dept. of the redundant
workload.

PAYROLL MANAGEMENT SYSTEM|

cAknowledgmt
The projecT work PAYROLL MANAGEMENT SYSYTEM is completed and now it is
before you. It is a result of our efforts.

With the help of Mr.Sanjeev Saxena Sir, our project guide and Mr.Nitin Kannojiya
Sir, our Java instructor only this project is possible. We could collect the various
information about the PAYROLL and the tools used in its preparing and the result is
in the form of our project work named
PAYROLL MANAGEMENT SYSTEM.

We are also greatful to our parents who not only helped us but also inspired and
encouraged us in completing the project work successfully and carefully. We hope
this project work will prove itself a milestone to others but the evaluation of this
project is in your hands.
With due regards to our elders, we pay our respect to them and dedicate this
project to them.

[TYPE

THE

CO M PA N Y

ADDRESS

PAYROLL MANAGEMENT SYSTEM|

tuSdenDarcoliPrefac
I am student of BCA (Bachelors Of Computer Application) declared that this project
report submitted for the fulfillment of BCA course 2009-2012. This project is
original and is not submitted anywhere.

Shubham Barnwal

PAYROLL MANAGEMENT SYSTEM|

Objectivs

The software development is this biggest challenge in information technology.


Fifteen years have elapsed since the development in IT sector for software

development. The entire scenario has been changed after this growth, now
peoples & organization are more likely to be depend on softwares like Property
Management, Financial Accounting, Sales order, Hospital etc.

Each software has its own strength and points of emphasis, depending on the

analysis of the systems have emphasized the computational and model based
assumption in softwares. This emphasized arises from the experience obtained in
software development unit with higher end professionals in IT sector.

The level of presentation for the best of end user in the organization. However it is
an attempt to provide the best in the industry.

SHUBHAM BARNWAL

Our team has decided to work on very popular topic Student Management that
keep all the maintenance of record of any data.

PAYROLL MANAGEMENT SYSTEM|

roPblemDfint
The system will be very much prevalent in coming to help the user friendly manner
to reduce paper work given rise to voluminous records and also to eliminate
difficulties which were being faced while using the manual system.

In the preparation of this project, we got full support of our college , our project
guide and also from the proprietor running Computer Labs for providing us
necessary information which is being required during course of development
software.
I was very overwhelmed doing this project and this project will serve us better
opportunities in future.

It is not easy to maintain this software with this short period of time. It takes our
hard efforts to work under this project. Sometimes we faced the problem of
connectivity with the database the hardware configuration, calculation processes
problem faced when data was not centralized.
PAYROLL MANAGEMENT SYSTEM|

aTbleofCnts

The documentation must be in scheduled and there must be the index of the
documentation by which one can search out any problem.

About the Project

Software Development Life cycle

NetBeans IDE

System Analysis

PAYROLL MANAGEMENT SYSTEM|

bAouthePrjc

Preliminary investigation
Feasibility Study
Technical Feasibility

Economic Feasibility

Operational Feasibility

Request Approval

Introduction About MSAccess

Hardware requirement

Software requirement

Database Design

Creating a java Application

Coding

System We Worked.
o Testing

o Data Flow Diagram

Testing

Conclusion
Future Enhancements
Bibliography

PAYROLL MANAGEMENT SYSTEM|

onameLcwDCSpvytrfil

This project provides the facility for payroll management . User can store the
information about properties and payment. Its also provides the facility for
maintain information about personnels and different users.

The software uses Ms-Access 8.1.5.0.0 (Enterprise Edition) as the back end and Net
Beans IDE as the front end. The choice of the software was definitely driven by
current demand of the software in todays market.

The software development life cycle (SDLC) (sometimes referred to as the system
development life cycle) is the process of creating or altering software systems, and
the models and methodologies that people use to develop these systems. In any
such lifecycle, people, process and technology all play a role in success. PTC is
committed to developing solutions for engineering (Software System Lifecycle
Management) and IT (Application Lifecycle Management) organizations along with
PAYROLL MANAGEMENT SYSTEM|

world class technology (PTC Integrity) to accelerate innovation in software


intensive products and systems.
Business analysts, architects, engineers, developers, quality managers, testers,
partners/suppliers and other stakeholders (across multiple locations and
organizations) all use PTC Integrity as the means for complete collaboration and
control over the end-to-end software development life cycle.
With seamless, collaborative management of all activities and assets, PTC Integrity
delivers greater transparency, better productivity and shorter cycle times across
the entire development lifecycle.

System analysis
The goal of system analysis is to determine where the problem is in an attempt to
fix the system. This step involves breaking down the system in different pieces to
analyze the situation, analyzing project goals, breaking down what needs to be
created and attempting to engage users so that definite requirements can be
defined.
Design
In systems design the design functions and operations are described in detail,
including screen layouts, business rules, process diagrams and other
documentation. The output of this stage will describe the new system as a
collection of modules or subsystems.
The design stage takes as its initial input the requirements identified in the
approved requirements document. For each requirement, a set of one or more
design elements will be produced as a result of interviews, workshops, and/or
prototype efforts.

PAYROLL MANAGEMENT SYSTEM|

10

Design elements describe the desired software features in detail, and generally
include functional hierarchy diagrams, screen layout diagrams, tables of business
rules, business process diagrams, pseudocode, and a complete entity-relationship
diagram with a full data dictionary. These design elements are intended to
describe the software in sufficient detail that skilled programmers may develop
the software with minimal additional input design.
Implementation
After testing is done of all those modules of the proposed project, the software is
now implemented into operational software. It involves programmers, users, &
operational managements. Implementation is the process of converting a new
software design.
Testing
The code is tested at various levels in software testing. Unit, system and user
acceptance testings are often performed. This is a grey area as many different
opinions exist as to what the stages of testing are and how much, if any iteration
occurs. Iteration is not generally part of the waterfall model, but usually some
occur at this stage. In the testing the whole system is test one by one
Following are the types of testing:
Defect testing the failed scenarios, including defect tracking
Path testing
Data set testing
Unit testing
System testing
Integration testing
Black-box testing
White-box testing
Regression testing
Automation testing
User acceptance testing
Software performance testing
Operations and maintenance
The deployment of the system includes changes and enhancements before the
decommissioning or sunset of the system. Maintaining the system is an important
aspect of SDLC. As key personnel change positions in the organization, new
changes will be implemented, which will require system.

PAYROLL MANAGEMENT SYSTEM|

11

etNBansDE6.91I

NetBeans refers to both a platform framework for Java desktop applications, and
an integrated development environment (IDE) for developing with Java,
JavaScript, PHP, Python (no longer supported after NetBeans 7), Groovy, C, C++,
Scala, Clojure, and others. The NetBeans IDE 7.0 no longer officially supports Ruby
and Ruby on Rails, but a third party plugin allows for development.
The NetBeans IDE is written in Java and can run on Windows, Mac OS, Linux, Solaris
and other platforms supporting a compatible JVM. A pre-existing JVM or a JDK is
not required.
The NetBeans platform allows applications to be developed from a set of modular
software components called modules. Applications based on the NetBeans platform
(including the NetBeans IDE) can be extended by third party developers.
Developer(s)

Oracle Corporation

Stable release

7.1.2 / April 26, 2012; 44 days ago


Preview release none
Written in
Java
Operating system Cross-platform (multi-platform)
Platform
Java SE
Available in
Multilingual
Type
Java IDE
CDDL or GPL2 + "certain source
License
files" allow classpath exception

PAYROLL MANAGEMENT SYSTEM|

12

etNBansDEcIi

Website

netbeans.org

It is not necessary to learn every feature of the NetBeans IDE before exploring its
GUI creation capabilities. In fact, the only features that you really need to
understand are the Palette, the Design Area, the Property Editor, and the
Inspector. We will discuss these features below.
PAYROLL MANAGEMENT SYSTEM|

13

The Palette
The Palette contains all of the components offered by the Swing API. You can
probably already guess what many of these components are for, even if this is your
first time using them (JLabel is a text label, JList is a drop-down list, etc.)

From this list, our application will use only JLabel (a basic text label), JTextField
(for the user to enter the temperature), and JButton (to convert the temperature
from Celsius to Fahrenheit.)
The Design Area

The figure above shows a single JFrame object, as represented by the large shaded
rectangle with blue border. Commonly expected behavior (such as quitting when
the user clicks the "close" button) is auto-generated by the IDE and appears in the
source view between uneditable blue sections of code known as guarded blocks.
PAYROLL MANAGEMENT SYSTEM|

14

A quick look at the source view reveals that the IDE has created a private method
named initComponents, which initializes the various components of the GUI. It also
tells the application to "exit on close", performs some layout-specific tasks, then
packs the (soon to be added) components together on screen.
Don't feel that you need to understand this code in any detail; we mention it here
simply to explore the source tab. For more information about these components,
see:
How to Make Frames (Main Windows) and Laying Out Components Within a
Container.
The Property Editor
The Property Editor does what its name implies: it allows you to edit the
properties of each component. The Property Editor is intuitive to use; in it you will
see a series of rows one row per property that you can click and edit without
entering the source code directly. The following figure shows the Property Editor
for the newly added JFrame object:

PAYROLL MANAGEMENT SYSTEM|

15

The screenshot above shows the various properties of this object, such as
background color, foreground color, font, and cursor.
The Inspector
The last component of the NetBeans IDE that we will use in this lesson is the
Inspector:

The Inspector
The Inspector provides a graphical representation of your application's
components. We will use the Inspector only once, to change a few variable names
to something other than their defaults.

PAYROLL MANAGEMENT SYSTEM|

16

ySstemAnali

Analysis is the detailed study of the various operations performed by the system
and their relationship within or outside the system. One aspect of analyzing the
system is defining the boundaries of the system and determining whether or not a
candidate.

System should consider other related system. During analysis, data are collection
on all available files. Decision points, and transactions handled by the present
system. Ones analysis is completed, the analyst has firm understanding of what is
done.

Preliminary Investigation

This phase is one in which a request is made by business system to receive the
assistance from system developers. The request may be made for various reasons.

PAYROLL MANAGEMENT SYSTEM|

17

The persons initiating the request might be: A customer


A distributor
An employee
A system specialist
This phase is broken into parts:

Request Clarification

Whenever a representative of a business system make request for a change, that


request might not have been clearly communicated, therefore before any system
investigation can commence, the project request must be examined to clearly
understand what the business system requires, In this phase the project request
has to be verified for its ingenuity to understand what the user wants.

Feasibility Study
an important outcome of the first phase is the determination of the project
requests feasibility.
There are three aspects of feasibility: Technical Feasibility
Determines whether the work for the project can be done with the existing
equipment, software technology and available personnel.
Economic Feasibility
Determine whether there are sufficient benefits in creating the system to make
cost acceptable, or the cost of the system is too high.
Operational feasibility
Finds out whether the system if developed will be used or will there be any strong
resistance from any component of the system.

Request Approval

The last part is request approval. Not all requested projects are both desirable
and feasible. Many projects requests are received from employees only a few of
whom can be perused. However, those projects that are both feasible and
desirable and desirable should be put into use so approval of the users has to be
got in order to start on other issues, such as cost, priority, completion time and
personal requirement.

PAYROLL MANAGEMENT SYSTEM|

18

tMCAnbduSEoac-Iri

Microsoft Access is a relational database management system (DBMS). At the most


basic level, a DBMS is a program that facilitates the storage the retrieval of
structure information on a computers hard drive. Example of well-know industrialstrength relational DBMS include Ms-Access.
A full-feature procedural programming language, essentially a subset of visual
basic.
A simplified procedural macro language unique to Access.

A rapid application development environment computer with visual form and


report development tools.
A sprinkling of objected-oriented extension.

Various wizards and builder to make development easier.

PAYROLL MANAGEMENT SYSTEM|

19

For new user, these multiple personalities can be a source of enormous


frustration. The problem is that each personality is based on a different set of
assumption and a different view of computing for instance.

The relational database personality expects you to view your application as


sets of data.
Microsoft SQL server.
IBM DB2.
Informix.
Well-know PC-based (desktop) relational DBMS include
Microsoft Access.
Microsoft Fox-pro.
Borland DBase.
The many faces of Access
Microsoft generally like to incorporate as many features as possible into its
product .For example, the Access package contains the following elements:

A relational database system that supports two industry standard query


language:
Structure Query language (SQL) and Query by Example (QBE);
What is Access?

The procedural programming personality expects you to view your


application as commands to be executed sequentially.

The object oriented personality expects you to view your application as


objects which encapsulate state and behavior information. Microsoft makes
no effort to provide an overall logical integration of these personalities
(indeed, it is unlikely that such integration is possible).Instead, it is up to
you as a developer to pick and choose the best approach to implementing
your application. Since there are often several vastly different ways to
implement a particular feature in access, recognizing the different
personalities and exploiting the best features (and avoiding the pitfalls) of
each are important skills for Access developer. The advantage of these
multiple personalities is that it is possible to use Access to learn about an
enormous range of information.
System concepts without introduction to Microsoft Access having
to
PAYROLL MANAGEMENT SYSTEM|

20

Interact with a large number of single-personality tools. for example:

Ms-Access for relational database.


Power Builder for rapid application,
Smalltalk for objects-oriented programming.

Keep this advantage in mind as we switch back and forth between personalities
and different computing paradigms.

Access database
Although the term database typically refers to a collection of related data
table, an Access database includes more than just data. In addition to table, an
Access database file contains several different types of database objects.

Saved queries for organizing data,


Forms for interacting with data on screen,
Reports for printing results,

Macros and visual basics programs for extending the functionality of


database application. These entire database objects are stored in a single
file named <filename>. MDB. When you are running Access, temporary
locking file named<filename>.LAB is also created you can safely ignore
the*.LAB file; everything of value is in the *.mdb file.
Microsoft Access documents are called database. An Access database is a
collection of database, object, table, queries, forms, reports, macros, and
modules. You can design new object or open existing ones to work with your
database unlike many database programs an Access database can contain all
of the objects that make up a database application in a single file with
the .mdb file name extension. For this reason, an Access database file is
sometimes called a database.

You can store general-purpose Microsoft Visual Basic for application procedures in a
library database. An Access database application can call procedures from a library
database. After establishing a link to the database. Called a reference. You can
create or purchase tools called add-ins to add custom feature to Access. Access
user-level security account information is stored in a database. Called a workgroup
information file.

PAYROLL MANAGEMENT SYSTEM|

21

TABLES:In Microsoft Access, you store data in table. Table organizes data into columns and
rows. Each row in a table is called a record. Each column in a record is called a
field. For example, each record in a Customer table contains information about
one customer. Each customers record contain fields name for each piece of
information you want to store about the customer, such as last name, first name,
address, city, state/province, postal code and phone. Users can enter and modify
data in table directly or through queries and data entry forms.

Storing related data in separate tables :You can create a separate table for each topic of data. Such as customers,
employees, or products. Using a separator table for each topic means that you
store that data only once, which makes your database .more efficient and reduces
data entry errors. For example If you, if you store both customer and order
information in one table, whenever a customer places an additional order, you
have to reenter information about that customer. Not only is this inefficient, but
errors can occur when information is reentered. If you keep separate table for
customer and orders, each customer has only one record in the Customer table. If
you need to update or correct information about a customer, you need to change
data in only one record. This method eliminates redundant entries and reduces
datacenter errors.

The process of eliminating redundancy by dividing data into separate related table
is called normalization. Access providers a wizard called the Table analyzer Wizard
to help you normalize your database.

Defining Relationships
To bring the data from multiple tables together for a query, form or report, you
define relationship between the tables based on a common piece of information
stored in both tables. For example a Customer table typically contains a Customer
ID field whose value uniquely identifies each customer. If the order table also has a
PAYROLL MANAGEMENT SYSTEM|

22

Customer_ID field, you can define a relationship between the two tables, so that
when you enter orders, you can enter a customers ID number to relate information
from the Customer table to that order. Instead of actually typing the
Customer_ID.you can use a lookup list box, as shown in the orders form the north
wind sample database.

PAYROLL MANAGEMENT SYSTEM|

23

ARHDWEMQUNTSI
System Type

Personal Computers

Processor Type

RAM

Pentium III 450 Mhz or higher

64 MB or Higher

HDD

Atleast 500 Mb of free Space for

Good performance

125 Mb Space required to intall

SVGA Modes

256 colour or Higher

PAYROLL MANAGEMENT SYSTEM|

24

and 800 * 600 resolution


Network

LAN network connected through

TCP/IP
LAN Cards

PAYROLL MANAGEMENT SYSTEM|

25

OFSTWAREMQUNI

Operating System

Windows 9x, NT, Me or XP Language

: Java 2 Runtime Environment Database


IDE

: MS Access2007

: Net Beans 6.7.1 and later

versions

PAYROLL MANAGEMENT SYSTEM|

26

PAYROLL MANAGEMENT SYSTEM|

27

ADTBSEIGN
LOGIN TABLE

FIELD NAME

TYPE

SIZE

USERNAME

TEXT

50

PASSWORD

TEXT

50

PAYROLL MANAGEMENT SYSTEM|

28

PERSONNEL TABLE
FIELD NAME

TYPE

SIZE

ID

LONG

NAME

TEXT

50

FSTHERS NAME

TEXT

50

DOB

DATE/TIME

DOJ

DATE/TIME

GENDER

TEXT

50

DEPARTMENT

TEXT

50

POST

TEXT

50

CONTACT

LONG

ADDRESS

TEXT

50

EMAIL

TEXT

50

SALARY

DOUBLE

SALARY TABLE
FIELD NAME

TYPE

SIZE

SLIP NO.

LONG

ID

LONG

NAME

TEXT

50

POST

TEXT

50

MONTH

TEXT

50

WORKINGDAYS

INTEGER

SALARY

DOUBLE

DA

DOUBLE

HRA

DOUBLE

TOTAL SAL

DOUBLE

PAYROLL MANAGEMENT SYSTEM|

29

TAX TABLE
FIELD NAME

TYPE

SIZE

ID

LONG

SLIP NO.

LONG

NAME

TEXT

50

DEPTT.

TEXT

50

POST

TEXT

50

TOTAL SALARY

DOUBLE

TAX

DOUBLE

PAYROLL MANAGEMENT SYSTEM|

30

CODINGMDIForm
PAYROLL MANAGEMENT SYSTEM|

31

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* mdi.java
*
* Created on Jun 9, 2012, 11:05:02 PM
*/

PAYROLL MANAGEMENT SYSTEM|

32

package rol;

/**
*
* @author Shubham Barnwal
*/
public class mdi extends javax.swing.JFrame {

/** Creates new form mdi */


public mdi() {
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() {

d1 = new javax.swing.JDesktopPane();
menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu();
openMenuItem = new javax.swing.JMenuItem();
saveMenuItem = new javax.swing.JMenuItem();
PAYROLL MANAGEMENT SYSTEM|

33

exitMenuItem = new javax.swing.JMenuItem();


editMenu = new javax.swing.JMenu();
cutMenuItem = new javax.swing.JMenuItem();
copyMenuItem = new javax.swing.JMenuItem();
pasteMenuItem = new javax.swing.JMenuItem();
deleteMenuItem = new javax.swing.JMenuItem();
helpMenu = new javax.swing.JMenu();
contentMenuItem = new javax.swing.JMenuItem();
aboutMenuItem = new javax.swing.JMenuItem();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu1 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem5 = new javax.swing.JMenuItem();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("PayRoll Management System");

d1.setBackground(new java.awt.Color(91, 147, 137));

menuBar.setBackground(new java.awt.Color(221, 236, 184));


menuBar.setFont(new java.awt.Font("Garamond", 0, 14));

fileMenu.setText("Personnel Management");
PAYROLL MANAGEMENT SYSTEM|

34

openMenuItem.setText("Register New Personnel");


openMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openMenuItemActionPerformed(evt);
}
});
fileMenu.add(openMenuItem);

saveMenuItem.setText("Search Personnel Details");


saveMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveMenuItemActionPerformed(evt);
}
});
fileMenu.add(saveMenuItem);

exitMenuItem.setText("Delete Existing Personnel");


exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitMenuItemActionPerformed(evt);
}
});
fileMenu.add(exitMenuItem);

menuBar.add(fileMenu);

PAYROLL MANAGEMENT SYSTEM|

35

editMenu.setText("Salary Management");

cutMenuItem.setText("Add Salary Details");


cutMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cutMenuItemActionPerformed(evt);
}
});
editMenu.add(cutMenuItem);

copyMenuItem.setText("Search Salary Details");


copyMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
copyMenuItemActionPerformed(evt);
}
});
editMenu.add(copyMenuItem);

pasteMenuItem.setText("Update Salary Details");


pasteMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
pasteMenuItemActionPerformed(evt);
}
});
editMenu.add(pasteMenuItem);

deleteMenuItem.setText("Delete Salary Details");


PAYROLL MANAGEMENT SYSTEM|

36

deleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
deleteMenuItemActionPerformed(evt);
}
});
editMenu.add(deleteMenuItem);

menuBar.add(editMenu);

helpMenu.setText("Tax Management");

contentMenuItem.setText("Calculate Tax");
contentMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
contentMenuItemActionPerformed(evt);
}
});
helpMenu.add(contentMenuItem);

aboutMenuItem.setText("Search Tax Details");


aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutMenuItemActionPerformed(evt);
}
});
helpMenu.add(aboutMenuItem);

PAYROLL MANAGEMENT SYSTEM|

37

jMenuItem1.setText("Remove Tax Details");


jMenuItem1.setName("jMenuItem1"); // NOI18N
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
helpMenu.add(jMenuItem1);

menuBar.add(helpMenu);

jMenu1.setText("Administrator");

jMenuItem2.setText("Add User");
jMenuItem2.setName("jMenuItem2"); // NOI18N
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem2);

jMenuItem3.setText("Remove User");
jMenuItem3.setName("jMenuItem3"); // NOI18N
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
PAYROLL MANAGEMENT SYSTEM|

38

}
});
jMenu1.add(jMenuItem3);

menuBar.add(jMenu1);

jMenu2.setText("About Us");
jMenu2.setName("jMenu2"); // NOI18N

jMenuItem4.setText("Click Here");
jMenuItem4.setName("jMenuItem4"); // NOI18N
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem4);

menuBar.add(jMenu2);

jMenu3.setText("Log out");
jMenu3.setName("jMenu3"); // NOI18N

jMenuItem5.setText("Log Out");
jMenuItem5.setName("jMenuItem5"); // NOI18N
jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PAYROLL MANAGEMENT SYSTEM|

39

jMenuItem5ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem5);

menuBar.add(jMenu3);

setJMenuBar(menuBar);

javax.swing.GroupLayout
javax.swing.GroupLayout(getContentPane());

layout

new

getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(d1, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 743, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(d1, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 504, Short.MAX_VALUE)
);

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

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


removepersonal pp=new removepersonal();
PAYROLL MANAGEMENT SYSTEM|

40

d1.add(pp);
pp.setVisible(true);
}

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


addpersonal ap=new addpersonal();
d1.add(ap);
ap.setVisible(true);
// TODO add your handling code here:
}

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


searchpersonal sp=new searchpersonal();
d1.add(sp);
sp.setVisible(true);
// TODO add your handling code here:
}

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


Addsal al=new Addsal();
d1.add(al);
al.setVisible(true);

// TODO add your handling code here:


}

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


PAYROLL MANAGEMENT SYSTEM|

41

Searchpay sp=new Searchpay();


d1.add(sp);
sp.setVisible(true);
// TODO add your handling code here:
}

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


updatepay up=new updatepay();
d1.add(up);
up.setVisible(true);
// TODO add your handling code here:
}

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


removepay rp=new removepay();
d1.add(rp);
rp.setVisible(true);
// TODO add your handling code here:
}

private void contentMenuItemActionPerformed(java.awt.event.ActionEvent evt)


{
addtax ax=new addtax();
d1.add(ax);
ax.setVisible(true);
// TODO add your handling code here:
}
PAYROLL MANAGEMENT SYSTEM|

42

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


searchtax ax=new searchtax();
d1.add(ax);
ax.setVisible(true);
// TODO add your handling code here:
}

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


removetax rt=new removetax();
d1.add(rt);
rt.setVisible(true);
// TODO add your handling code here:
}

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

Aduser au=new Aduser();


d1.add(au);
au.setVisible(true);
// TODO add your handling code here:
}

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


RemoveUser rv=new RemoveUser();
d1.add(rv);
rv.setVisible(true);
PAYROLL MANAGEMENT SYSTEM|

43

// TODO add your handling code here:


}

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


this.setVisible(false);
LogIn ln=new LogIn();
ln.setVisible(true);
// TODO add your handling code here:
}

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


About b=new About();
d1.add(b);
b.setVisible(true);
// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new mdi().setVisible(true);
}
});
}
PAYROLL MANAGEMENT SYSTEM|

44

// Variables declaration - do not modify


private javax.swing.JMenuItem aboutMenuItem;
private javax.swing.JMenuItem contentMenuItem;
private javax.swing.JMenuItem copyMenuItem;
private javax.swing.JMenuItem cutMenuItem;
private javax.swing.JDesktopPane d1;
private javax.swing.JMenuItem deleteMenuItem;
private javax.swing.JMenu editMenu;
private javax.swing.JMenuItem exitMenuItem;
private javax.swing.JMenu fileMenu;
private javax.swing.JMenu helpMenu;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenuItem openMenuItem;
private javax.swing.JMenuItem pasteMenuItem;
private javax.swing.JMenuItem saveMenuItem;
// End of variables declaration

}
PAYROLL MANAGEMENT SYSTEM|

45

LoginFrm
PAYROLL MANAGEMENT SYSTEM|

46

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* LogIn.java

PAYROLL MANAGEMENT SYSTEM|

47

*
* Created on May 14, 2012, 7:34:13 PM
*/

package rol;
import java.sql.*;
import java.lang.String.*;
import javax.swing.JOptionPane;
/**
*
* @author Administrator
*/
public class LogIn extends javax.swing.JFrame {

/** Creates new form LogIn */


public LogIn() {
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() {
PAYROLL MANAGEMENT SYSTEM|

48

jPanel2 = new javax.swing.JPanel();


jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
tid = new javax.swing.JTextField();
tpwd = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();

jPanel2.setName("jPanel2"); // NOI18N

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
PAYROLL MANAGEMENT SYSTEM|

49

);

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("PayRoll System");
setBackground(new java.awt.Color(51, 255, 0));

jPanel1.setBackground(new java.awt.Color(102, 102, 102));


jPanel1.setForeground(new java.awt.Color(51, 0, 51));
jPanel1.setName("jPanel1"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("User Name");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Password");
jLabel3.setName("jLabel3"); // NOI18N

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


tid.setFont(new java.awt.Font("Aharoni", 0, 18));
tid.setForeground(new java.awt.Color(0, 0, 255));
tid.setName("tid"); // NOI18N

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


PAYROLL MANAGEMENT SYSTEM|

50

tpwd.setFont(new java.awt.Font("Aharoni", 0, 18));


tpwd.setForeground(new java.awt.Color(0, 0, 255));
tpwd.setName("tpwd"); // NOI18N
tpwd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tpwdActionPerformed(evt);
}
});

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14));
jButton1.setText("Sign In");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setFont(new java.awt.Font("Garamond", 1, 14));
jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
PAYROLL MANAGEMENT SYSTEM|

51

});

jLabel5.setFont(new java.awt.Font("Garamond", 1, 24));


jLabel5.setIcon(new
javax.swing.ImageIcon("D:\\pay\\payroll_management_02_5.jpg")); // NOI18N
jLabel5.setText("PayRoll Mgmt System");
jLabel5.setName("jLabel5"); // NOI18N

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 14));


jLabel4.setForeground(new java.awt.Color(0, 255, 204));
jLabel4.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled16.png")); //
NOI18N
jLabel4.setText("Forget Password ?");
jLabel4.setName("jLabel4"); // NOI18N

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


jButton3.setText("Get New Here");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Payroll-management
(2).jpg")); // NOI18N
jLabel1.setText("jLabel1");
jLabel1.setBorder(new javax.swing.border.MatteBorder(null));
PAYROLL MANAGEMENT SYSTEM|

52

jLabel1.setName("jLabel1"); // NOI18N

javax.swing.GroupLayout jPanel1Layout = new


javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.TRAILING, false)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE))
.addGap(94, 94, 94)
.addComponent(jButton3))
.addGroup(jPanel1Layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

53

.addGap(76, 76, 76)


.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 125,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(34, 34, 34))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 155,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.LEADING, false)
.addComponent(tpwd,
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(tid,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(60, 60, 60)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_SIZE, 198,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(58, 58, 58)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 301,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel1Layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

54

.addContainerGap()
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 961,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.BASELINE)
.addComponent(tid, javax.swing.GroupLayout.PREFERRED_SIZE,
25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.BASELINE)
PAYROLL MANAGEMENT SYSTEM|

55

.addComponent(tpwd,
javax.swing.GroupLayout.PREFERRED_SIZE, 23,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 34,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(8, 8, 8)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment
.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 26,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel5))
.addGap(428, 428, 428))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
PAYROLL MANAGEMENT SYSTEM|

56

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 519,
javax.swing.GroupLayout.PREFERRED_SIZE)
);

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

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


// TODO add your handling code here:
}

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


String id=tid.getText().trim();
String pwd=tpwd.getText().trim();

if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter User Name");

}
else if(pwd.length() == 0)
{
JOptionPane.showMessageDialog(null,"Enter the Password");
}
else

PAYROLL MANAGEMENT SYSTEM|

57

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps;
ps=con.prepareStatement("select *
from log where uname=?");
ps.setString(1,id);
ResultSet res=ps.executeQuery();
if(res.next())
{
String
str=res.getString(2).trim();
if(str.equals(pwd))
{
JOptionPane.showMessageDialog(null,"Valid User");
this.setVisible(false);
mdi md=new mdi();
md.setVisible(true);

}
else
{
JOptionPane.showMessageDialog(null,"Invalid
Password");
}
PAYROLL MANAGEMENT SYSTEM|

58

}
else
{
JOptionPane.showMessageDialog(null,"Invalid User
Name");
}

}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
// TODO add your handling code here:
}

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


tid.setText("");
tpwd.setText("");
// TODO add your handling code here:
}

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


this.setVisible(false);
updatepass pass=new updatepass();
pass.setVisible(true);
PAYROLL MANAGEMENT SYSTEM|

59

// TODO add your handling code here:


}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LogIn().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.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField tid;
private javax.swing.JPasswordField tpwd;
PAYROLL MANAGEMENT SYSTEM|

60

bAoutUsFrm
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

61

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* About.java
PAYROLL MANAGEMENT SYSTEM|

62

*
* Created on Jun 10, 2012, 6:07:51 PM
*/

package rol;

/**
*
* @author Shubham Barnwal
*/
public class About extends javax.swing.JInternalFrame {

/** Creates new form About */


public About() {
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() {

jSeparator1 = new javax.swing.JSeparator();


PAYROLL MANAGEMENT SYSTEM|

63

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();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jSeparator2 = new javax.swing.JSeparator();
jLabel9 = new javax.swing.JLabel();

jSeparator1.setName("jSeparator1"); // NOI18N

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(153, 0, 0)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

jLabel1.setBackground(new java.awt.Color(0, 0, 0));


jLabel1.setFont(new java.awt.Font("Garamond", 1, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(51, 255, 51));
jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled5.png")); //
NOI18N
jLabel1.setName("jLabel1"); // NOI18N

jLabel2.setBackground(new java.awt.Color(0, 0, 0));


PAYROLL MANAGEMENT SYSTEM|

64

jLabel2.setFont(new java.awt.Font("Aharoni", 1, 24)); // NOI18N


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Compatible for all Windows Operating Systems");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 1, 24));


jLabel3.setForeground(new java.awt.Color(0, 255, 204));
jLabel3.setText("Developed By:");
jLabel3.setName("jLabel3"); // NOI18N

jLabel4.setBackground(new java.awt.Color(0, 22, 31));


jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Shubham Barnwal");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setBackground(new java.awt.Color(0, 22, 31));


jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18));
jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Sunil Krishna Saxena");
jLabel5.setName("jLabel5"); // NOI18N

jLabel6.setBackground(new java.awt.Color(0, 22, 31));


jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18));
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Shivam Rastogi");
jLabel6.setName("jLabel6"); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

65

jLabel7.setBackground(new java.awt.Color(0, 22, 31));


jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18));
jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("Prashant Gangwar");
jLabel7.setName("jLabel7"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel8.setForeground(new java.awt.Color(240, 240, 240));
jLabel8.setText("Version 1.1");
jLabel8.setName("jLabel8"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

jLabel9.setIcon(new javax.swing.ImageIcon("D:\\pay\\payrollhomebanner.jpg")); // NOI18N


jLabel9.setText("jLabel9");
jLabel9.setName("jLabel9"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE,
699, javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

66

.addContainerGap(32, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(356, Short.MAX_VALUE)
.addComponent(jLabel8)
.addGap(322, 322, 322))
.addGroup(layout.createSequentialGroup()
.addGap(103, 103, 103)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel2))
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jSeparator2))
.addContainerGap(96, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(322, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel4)
.addComponent(jLabel3))
PAYROLL MANAGEMENT SYSTEM|

67

.addGap(15, 15, 15))


.addComponent(jLabel5)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7,
javax.swing.GroupLayout.PREFERRED_SIZE, 180,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 3,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(261, 261, 261))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE,
163, Short.MAX_VALUE)
.addGap(11, 11, 11)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 65,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(11, 11, 11)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
PAYROLL MANAGEMENT SYSTEM|

68

.addComponent(jLabel8)
.addGap(26, 26, 26)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 11,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 22,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(42, 42, 42))
);

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

// Variables declaration - do not modify


PAYROLL MANAGEMENT SYSTEM|

69

AnaohMwNRdSeycrtfl
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.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;

private javax.swing.JSeparator jSeparator1;


private javax.swing.JSeparator jSeparator2;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

70

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* Addsal.java
PAYROLL MANAGEMENT SYSTEM|

71

*
* Created on Jun 10, 2012, 1:09:05 AM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham
*/
public class Addsal extends javax.swing.JInternalFrame {

/** Creates new form Addsal */


public Addsal() {
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() {
PAYROLL MANAGEMENT SYSTEM|

72

jTextField5 = new javax.swing.JTextField();


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();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
r1 = new javax.swing.JTextField();
r2 = new javax.swing.JTextField();
r3 = new javax.swing.JTextField();
r4 = new javax.swing.JTextField();
r5 = new javax.swing.JComboBox();
r6 = new javax.swing.JTextField();
r7 = new javax.swing.JTextField();
r8 = new javax.swing.JTextField();
r9 = new javax.swing.JTextField();
r10 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
PAYROLL MANAGEMENT SYSTEM|

73

jButton4 = new javax.swing.JButton();


jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();

jTextField5.setText("jTextField5");
jTextField5.setName("jTextField5"); // NOI18N

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(153, 0, 0)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

jLabel1.setFont(new java.awt.Font("Garamond", 1, 24));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled3.png")); //
NOI18N
jLabel1.setName("jLabel1"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Slip No.");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Personnel Id");
PAYROLL MANAGEMENT SYSTEM|

74

jLabel3.setName("jLabel3"); // NOI18N

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Personnel Name");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Post");
jLabel5.setName("jLabel5"); // NOI18N

jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Month");
jLabel6.setName("jLabel6"); // NOI18N

jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("No. Of Working Days");
jLabel7.setName("jLabel7"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Salary");
jLabel8.setName("jLabel8"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

75

jLabel9.setName("jLabel9"); // NOI18N

jLabel10.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel10.setForeground(new java.awt.Color(255, 255, 255));
jLabel10.setText("Total Salary");
jLabel10.setName("jLabel10"); // NOI18N

jLabel11.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel11.setForeground(new java.awt.Color(255, 255, 255));
jLabel11.setText("DA");
jLabel11.setName("jLabel11"); // NOI18N

jLabel12.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel12.setForeground(new java.awt.Color(255, 255, 255));
jLabel12.setText("HRA");
jLabel12.setName("jLabel12"); // NOI18N

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


r1.setFont(new java.awt.Font("Aharoni", 0, 12));
r1.setForeground(new java.awt.Color(51, 51, 255));
r1.setName("r1"); // NOI18N

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


r2.setFont(new java.awt.Font("Aharoni", 0, 12));
r2.setForeground(new java.awt.Color(51, 51, 255));
r2.setName("r2"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

76

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


r3.setFont(new java.awt.Font("Aharoni", 0, 12));
r3.setForeground(new java.awt.Color(51, 51, 255));
r3.setName("r3"); // NOI18N

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


r4.setFont(new java.awt.Font("Aharoni", 0, 12));
r4.setForeground(new java.awt.Color(51, 51, 255));
r4.setName("r4"); // NOI18N

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


r5.setFont(new java.awt.Font("Aharoni", 0, 12));
r5.setForeground(new java.awt.Color(51, 51, 255));
r5.setModel(new javax.swing.DefaultComboBoxModel(new String[]
{ "1.January", "2. Febuary", "3. March", "4. Appril", "5. May", "6. June", "7. Jully", "8.
August", "9. September", "10.October", "11. November", "12. December" }));
r5.setName("r5"); // NOI18N

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


r6.setFont(new java.awt.Font("Aharoni", 0, 12));
r6.setForeground(new java.awt.Color(51, 51, 255));
r6.setName("r6"); // NOI18N

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


r7.setFont(new java.awt.Font("Aharoni", 0, 12));
r7.setForeground(new java.awt.Color(51, 51, 255));
r7.setName("r7"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

77

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


r8.setFont(new java.awt.Font("Aharoni", 0, 12));
r8.setForeground(new java.awt.Color(51, 51, 255));
r8.setName("r8"); // NOI18N

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


r9.setFont(new java.awt.Font("Aharoni", 0, 12));
r9.setForeground(new java.awt.Color(51, 51, 255));
r9.setName("r9"); // NOI18N

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


r10.setFont(new java.awt.Font("Aharoni", 0, 12));
r10.setForeground(new java.awt.Color(51, 51, 255));
r10.setName("r10"); // NOI18N
r10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
r10ActionPerformed(evt);
}
});

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


jButton1.setText("Calculate Total Salary");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
PAYROLL MANAGEMENT SYSTEM|

78

});

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


jButton2.setText("Add Pay");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

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


jButton3.setText("Reset");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton4.setBackground(new java.awt.Color(204, 204, 204));


jButton4.setText("Cancel");
jButton4.setName("jButton4"); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
PAYROLL MANAGEMENT SYSTEM|

79

});

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

jSeparator3.setName("jSeparator3"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(162, 162, 162)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel11)
.addComponent(jLabel12)
.addComponent(jLabel8))
.addGap(177, 177, 177))
.addGroup(layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

80

.addComponent(jLabel7)
.addGap(49, 49, 49)))
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(r6,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

81

.addGap(128, 128, 128))


.addGroup(layout.createSequentialGroup()
.addComponent(r5,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(128, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addComponent(r4,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(r2,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()))
.addGroup(layout.createSequentialGroup()
.addComponent(r1,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()))
.addGroup(layout.createSequentialGroup()
.addComponent(r7,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()))
.addGroup(layout.createSequentialGroup()
.addComponent(r8,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()))

PAYROLL MANAGEMENT SYSTEM|

82

.addGroup(layout.createSequentialGroup()
.addComponent(r9, javax.swing.GroupLayout.PREFERRED_SIZE,
133, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap()))
.addGroup(layout.createSequentialGroup()
.addComponent(r3, javax.swing.GroupLayout.PREFERRED_SIZE,
133, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
.addGroup(layout.createSequentialGroup()
.addGap(168, 168, 168)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE,
132, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(92, 92, 92)
.addComponent(r10, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(128, 128, 128))
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(94, 94, 94)
PAYROLL MANAGEMENT SYSTEM|

83

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jSeparator3,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
.addComponent(jButton1,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
.addComponent(jSeparator2,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
.addComponent(jButton3,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
.addComponent(jButton4,
javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE))
.addGap(106, 106, 106))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(r1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
PAYROLL MANAGEMENT SYSTEM|

84

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel3)
.addComponent(r2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel4)
.addComponent(r3, javax.swing.GroupLayout.PREFERRED_SIZE, 19,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(17, 17, 17)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel5)
.addComponent(r4, javax.swing.GroupLayout.PREFERRED_SIZE, 19,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel6)
.addComponent(r5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

PAYROLL MANAGEMENT SYSTEM|

85

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel7)
.addComponent(r6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(7, 7, 7)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator3,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel8)
.addComponent(r7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

PAYROLL MANAGEMENT SYSTEM|

86

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel11)
.addComponent(r8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel12)
.addComponent(r9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel10)
.addComponent(r10, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(11, 11, 11)

PAYROLL MANAGEMENT SYSTEM|

87

.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 24,


Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton4)
.addGap(16, 16, 16))
);

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

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


// TODO add your handling code here:
}

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


String slip=r1.getText().trim();
if(slip.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Slip
No...");
return;
}
String id=r2.getText().trim();
if(id.length()==0)
PAYROLL MANAGEMENT SYSTEM|

88

{
JOptionPane.showMessageDialog(null," Enter
Employee ID..");
return;
}
String name=r3.getText().trim();
if(name.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee Name..");
return;
}
String post=r4.getText().trim();
if(post.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee Post");
return;
}
String month=(String) r5.getSelectedItem();
if(month.length()==0) {
JOptionPane.showMessageDialog(null,"Select month");
return;
}
String work=r6.getText().trim();
if(work.length()==0)
PAYROLL MANAGEMENT SYSTEM|

89

{
JOptionPane.showMessageDialog(null,"Enter No Of
Working Day");
return;
}
String sal=r7.getText().trim();
if(sal.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee Salaryr");
return;
}

String da=r8.getText().trim();
if(da.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Da");
return;
}
String hra=r9.getText().trim();
if(hra.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee HRA");
return;
PAYROLL MANAGEMENT SYSTEM|

90

}
String total=r10.getText().trim();
if(total.length()==0)
{
JOptionPane.showMessageDialog(null,"Calculate
Employee Total Salary ");
return;
}

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement
ps=con.prepareStatement("insert into sal values(?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,slip);
ps.setString(2,id);
ps.setString(3,name);
ps.setString(4,post);
ps.setString(5,month);
ps.setString(6,work);
ps.setString(7,sal);
ps.setString(8,da);
PAYROLL MANAGEMENT SYSTEM|

91

ps.setString(9,hra);
ps.setString(10,total);

int i=ps.executeUpdate();
if(i>0)
{
JOptionPane.showMessageDialog(null,"Eployee Details
Add");
}
else
{
JOptionPane.showMessageDialog(null,"Record not
Save");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

}
// TODO add your handling code here:
}

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

int d,h,s,sum;
PAYROLL MANAGEMENT SYSTEM|

92

String sal=r7.getText();
String da=r8.getText();
String hra=r9.getText();
d=Integer.parseInt(da);
h=Integer.parseInt(hra);
s=Integer.parseInt(sal);
sum=(d+h+s);

String str=String.valueOf(sum);
r10.setText(str);
// TODO add yourhandling code here:
}

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

r1.setText("");
r2.setText("");
r3.setText("");
r4.setText("");
r6.setText("");
r7.setText("");
r8.setText("");
r9.setText("");
r10.setText("");

PAYROLL MANAGEMENT SYSTEM|

93

// TODO add your handling code here:


}

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

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

// 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.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
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.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
PAYROLL MANAGEMENT SYSTEM|

94

ewNUsrRtagoni
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField r1;

private javax.swing.JTextField r10;


private javax.swing.JTextField r2;
private javax.swing.JTextField r3;
private javax.swing.JTextField r4;

private javax.swing.JComboBox r5;


private javax.swing.JTextField r6;
private javax.swing.JTextField r7;
private javax.swing.JTextField r8;
private javax.swing.JTextField r9;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

95

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* Aduser.java
*
PAYROLL MANAGEMENT SYSTEM|

96

* Created on May 19, 2012, 8:35:13 AM


*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Administrator
*/
public class Aduser extends javax.swing.JInternalFrame {

/** Creates new form Aduser */


public Aduser() {
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() {

PAYROLL MANAGEMENT SYSTEM|

97

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
ad1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
ad2 = new javax.swing.JPasswordField();
ad3 = new javax.swing.JPasswordField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();

setBackground(new java.awt.Color(102, 102, 102));


setClosable(true);
setIconifiable(true);
setMaximizable(true);
setTitle("Payroll Management System");

jLabel1.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("User Name");
jLabel1.setName("jLabel1"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


PAYROLL MANAGEMENT SYSTEM|

98

jLabel2.setForeground(new java.awt.Color(255, 255, 255));


jLabel2.setText("Password");
jLabel2.setName("jLabel2"); // NOI18N

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


ad1.setFont(new java.awt.Font("Aharoni", 0, 18));
ad1.setForeground(new java.awt.Color(0, 0, 255));
ad1.setName("ad1"); // NOI18N

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14)); // NOI18N
jButton1.setText("Register");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setFont(new java.awt.Font("Garamond", 1, 14));
jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
PAYROLL MANAGEMENT SYSTEM|

99

});

jLabel3.setFont(new java.awt.Font("Elephant", 0, 18)); // NOI18N


jLabel3.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled15.png")); //
NOI18N
jLabel3.setText("

Add New User");

jLabel3.setName("jLabel3"); // NOI18N

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


ad2.setFont(new java.awt.Font("Aharoni", 0, 18));
ad2.setForeground(new java.awt.Color(0, 0, 255));
ad2.setName("ad2"); // NOI18N

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


ad3.setFont(new java.awt.Font("Aharoni", 0, 18));
ad3.setForeground(new java.awt.Color(0, 0, 255));
ad3.setName("ad3"); // NOI18N
ad3.addInputMethodListener(new java.awt.event.InputMethodListener() {
public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
}
public void inputMethodTextChanged(java.awt.event.InputMethodEvent
evt) {
ad3InputMethodTextChanged(evt);
}
});

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
PAYROLL MANAGEMENT SYSTEM|

100

jLabel4.setText("Confirm Password");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setIcon(new
javax.swing.ImageIcon("D:\\pay\\payroll_management_02_5.jpg")); // NOI18N
jLabel5.setText("jLabel5");
jLabel5.setName("jLabel5"); // NOI18N

jButton3.setFont(new java.awt.Font("Garamond", 1, 14));


jButton3.setText("Cancel");
jButton3.setName("jButton3"); // NOI18N

jSeparator1.setName("jSeparator1"); // NOI18N

jLabel6.setIcon(new javax.swing.ImageIcon("D:\\pay\\Payroll-ManagementServices_250x250.jpg")); // NOI18N


jLabel6.setText("jLabel6");
jLabel6.setName("jLabel6"); // NOI18N

jLabel7.setIcon(new javax.swing.ImageIcon("D:\\pay\\Payroll-ManagementServices_250x250.jpg")); // NOI18N


jLabel7.setText("jLabel7");
jLabel7.setName("jLabel7"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
PAYROLL MANAGEMENT SYSTEM|

101

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(124, 124, 124)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 100,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 98,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3,
javax.swing.GroupLayout.PREFERRED_SIZE, 91,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(jSeparator1,
javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
PAYROLL MANAGEMENT SYSTEM|

102

.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel4))
.addGap(93, 93, 93)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(ad1,
javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
.addComponent(ad2)
.addComponent(ad3))))))
.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 591,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7,
javax.swing.GroupLayout.PREFERRED_SIZE, 131,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 309,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6, 0, 0, Short.MAX_VALUE)))))
.addContainerGap(22, javax.swing.GroupLayout.PREFERRED_SIZE))
PAYROLL MANAGEMENT SYSTEM|

103

);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE,
151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE,
149, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 68,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(ad1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)

PAYROLL MANAGEMENT SYSTEM|

104

.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ad2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(ad3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(17, 17, 17)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(22, 22, 22)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jButton1)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE,
25, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38))
);

pack();
}// </editor-fold>
PAYROLL MANAGEMENT SYSTEM|

105

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


String id=ad1.getText().trim();
if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter User
Name");
return;
}
String username=ad2.getText().trim();

if(username.length() == 0)
{
JOptionPane.showMessageDialog(null,"Enter User
PassWord");
}

String cn=ad3.getText().trim();

if (cn.length() == 0)

PAYROLL MANAGEMENT SYSTEM|

106

{
JOptionPane.showMessageDialog(null,"Enter ConFirm
PassWord");

else

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps;
ps=con.prepareStatement("insert into log
values(?,?)");
ps.setString(1,id);
ps.setString(2,username);

int i=ps.executeUpdate();
if(i>0)
{

JOptionPane.showMessageDialog(null,"User
Add");
PAYROLL MANAGEMENT SYSTEM|

107

con.close();
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}

// TODO add your handling code here:

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


ad1.setText("");
ad2.setText("");
ad3.setText("");
// TODO add your handling code here:
}

private void ad3InputMethodTextChanged(java.awt.event.InputMethodEvent evt)


{

// TODO add your handling code here:


}

// Variables declaration - do not modify


private javax.swing.JTextField ad1;
private javax.swing.JPasswordField ad2;
PAYROLL MANAGEMENT SYSTEM|

108

eDltUsrFom
private javax.swing.JPasswordField ad3;
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.JLabel jLabel6;
private javax.swing.JLabel jLabel7;

private javax.swing.JSeparator jSeparator1;


// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

109

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* RemoveUser.java
*
* Created on May 14, 2012, 7:54:10 PM
PAYROLL MANAGEMENT SYSTEM|

110

*/

package rol;
import java.sql.*;
import java.lang.String.*;
import javax.swing.JOptionPane;

/**
*
* @author Administrator
*/
public class RemoveUser extends javax.swing.JInternalFrame {

/** Creates new form RemoveUser */


public RemoveUser() {
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() {

PAYROLL MANAGEMENT SYSTEM|

111

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
RU1 = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

setBackground(new java.awt.Color(102, 102, 102));


setClosable(true);
setIconifiable(true);
setMaximizable(true);
setTitle("Payroll Management System");
setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);

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


jLabel1.setForeground(new java.awt.Color(0, 255, 255));
jLabel1.setText("Kindly enter the username which is to be deleted");
jLabel1.setName("jLabel1"); // NOI18N

jLabel2.setFont(new java.awt.Font("Garamond", 0, 14));


jLabel2.setName("jLabel2"); // NOI18N

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


RU1.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
RU1.setForeground(new java.awt.Color(0, 102, 204));
RU1.setName("RU1"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

112

jLabel7.setFont(new java.awt.Font("Elephant", 0, 18)); // NOI18N


jLabel7.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled17.png")); //
NOI18N
jLabel7.setText("Remove User");
jLabel7.setName("jLabel7"); // NOI18N

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14)); // NOI18N
jButton1.setText("Delete");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setFont(new java.awt.Font("Garamond", 1, 14)); // NOI18N
jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
PAYROLL MANAGEMENT SYSTEM|

113

getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jLabel7,
javax.swing.GroupLayout.PREFERRED_SIZE, 502,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(76, 76, 76)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel1)
.addComponent(jLabel2)))
.addGroup(layout.createSequentialGroup()
.addGap(255, 255, 255)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(RU1,
javax.swing.GroupLayout.PREFERRED_SIZE, 84,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(jButton1,
javax.swing.GroupLayout.Alignment.TRAILING,
PAYROLL MANAGEMENT SYSTEM|

114

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))))
.addContainerGap(39, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 61,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RU1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(49, 49, 49)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
PAYROLL MANAGEMENT SYSTEM|

115

.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(33, Short.MAX_VALUE))
);

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

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


RU1.setText("");
// TODO add your handling code here:
}

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


String username=RU1.getText().trim();
if(username.length()==0)
{
JOptionPane.showMessageDialog(null,"ENTER
username ");
}
else
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;

PAYROLL MANAGEMENT SYSTEM|

116

con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement
ps=con.prepareStatement("delete from log where uname=? ");
ps.setString(1,username.trim());
int i=ps.executeUpdate();
if(i>0)
{
JOptionPane.showMessageDialog(null,"User Deleted");
}
else
{
JOptionPane.showMessageDialog(null,"User not
Present in DataBase");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
// TODO add your handling code here:
}

// Variables declaration - do not modify


private javax.swing.JTextField RU1;
PAYROLL MANAGEMENT SYSTEM|

117

StlRcFamoMysdhnerf
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel7;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

118

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* Searchpay.java
PAYROLL MANAGEMENT SYSTEM|

119

*
* Created on Jun 10, 2012, 7:41:11 AM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class Searchpay extends javax.swing.JInternalFrame {

/** Creates new form Searchpay */


public Searchpay() {
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() {
PAYROLL MANAGEMENT SYSTEM|

120

jScrollBar1 = new javax.swing.JScrollBar();


p7 = new javax.swing.JTextField();
p6 = new javax.swing.JTextField();
p10 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
p8 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
p9 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
p1 = new javax.swing.JTextField();
p2 = new javax.swing.JTextField();
p3 = new javax.swing.JTextField();
p4 = new javax.swing.JTextField();
p5 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel9 = new javax.swing.JLabel();
PAYROLL MANAGEMENT SYSTEM|

121

jSeparator2 = new javax.swing.JSeparator();


jSeparator3 = new javax.swing.JSeparator();

jScrollBar1.setName("jScrollBar1"); // NOI18N

setBackground(new java.awt.Color(102, 102, 102));


setClosable(true);
setIconifiable(true);
setTitle("Pay Role System");

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


p7.setFont(new java.awt.Font("Aharoni", 0, 18));
p7.setForeground(new java.awt.Color(0, 0, 255));
p7.setName("p7"); // NOI18N

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


p6.setFont(new java.awt.Font("Aharoni", 0, 18));
p6.setForeground(new java.awt.Color(0, 0, 255));
p6.setName("p6"); // NOI18N

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


p10.setFont(new java.awt.Font("Aharoni", 0, 18));
p10.setForeground(new java.awt.Color(0, 0, 255));
p10.setName("p10"); // NOI18N
p10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
p10ActionPerformed(evt);
PAYROLL MANAGEMENT SYSTEM|

122

}
});

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Personnel Name");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Post");
jLabel5.setName("jLabel5"); // NOI18N

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


p8.setFont(new java.awt.Font("Aharoni", 0, 18));
p8.setForeground(new java.awt.Color(0, 0, 255));
p8.setName("p8"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Slip No.");
jLabel2.setName("jLabel2"); // NOI18N

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


p9.setFont(new java.awt.Font("Aharoni", 0, 18));
p9.setForeground(new java.awt.Color(0, 0, 255));
p9.setName("p9"); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

123

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(0, 255, 255));
jLabel3.setText("Kindly enter the Personnel ID whose record of monthly salary
");
jLabel3.setName("jLabel3"); // NOI18N

jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("No. Of Working Days");
jLabel7.setName("jLabel7"); // NOI18N

jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Month");
jLabel6.setName("jLabel6"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Salary");
jLabel8.setName("jLabel8"); // NOI18N

jLabel10.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel10.setForeground(new java.awt.Color(255, 255, 255));
jLabel10.setText("Total Salary");
jLabel10.setName("jLabel10"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

124

jLabel11.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel11.setForeground(new java.awt.Color(255, 255, 255));
jLabel11.setText("DA");
jLabel11.setName("jLabel11"); // NOI18N

jLabel12.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel12.setForeground(new java.awt.Color(255, 255, 255));
jLabel12.setText("HRA");
jLabel12.setName("jLabel12"); // NOI18N

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


p1.setFont(new java.awt.Font("Aharoni", 0, 18));
p1.setForeground(new java.awt.Color(0, 0, 255));
p1.setName("p1"); // NOI18N

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


p2.setFont(new java.awt.Font("Aharoni", 0, 18));
p2.setForeground(new java.awt.Color(0, 0, 255));
p2.setName("p2"); // NOI18N

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


p3.setFont(new java.awt.Font("Aharoni", 0, 18));
p3.setForeground(new java.awt.Color(0, 0, 255));
p3.setName("p3"); // NOI18N

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


p4.setFont(new java.awt.Font("Aharoni", 0, 18));
PAYROLL MANAGEMENT SYSTEM|

125

p4.setForeground(new java.awt.Color(0, 0, 255));


p4.setName("p4"); // NOI18N

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


p5.setFont(new java.awt.Font("Aharoni", 0, 18));
p5.setForeground(new java.awt.Color(0, 0, 255));
p5.setName("p5"); // NOI18N

jLabel1.setFont(new java.awt.Font("Garamond", 0, 24));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled4.png")); //
NOI18N
jLabel1.setText("Search Monthly Pay Details");
jLabel1.setName("jLabel1"); // NOI18N

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


jButton1.setText("Search Pay");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Cancel");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
PAYROLL MANAGEMENT SYSTEM|

126

public void actionPerformed(java.awt.event.ActionEvent evt) {


jButton2ActionPerformed(evt);
}
});

jSeparator1.setName("jSeparator1"); // NOI18N

jLabel9.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel9.setForeground(new java.awt.Color(0, 255, 255));
jLabel9.setText("is to be searched");
jLabel9.setName("jLabel9"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

jSeparator3.setName("jSeparator3"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
591, javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

127

.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jLabel3))
.addGroup(layout.createSequentialGroup()
.addGap(247, 247, 247)
.addComponent(jLabel9))
.addGroup(layout.createSequentialGroup()
.addGap(280, 280, 280)
.addComponent(p2, javax.swing.GroupLayout.PREFERRED_SIZE,
68, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(32, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(249, 249, 249)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel12,
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel8,
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel11,
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel10,
javax.swing.GroupLayout.Alignment.TRAILING))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(p10)
.addComponent(p9)
PAYROLL MANAGEMENT SYSTEM|

128

.addComponent(p8)
.addComponent(p7, javax.swing.GroupLayout.PREFERRED_SIZE, 83,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(221, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(159, 159, 159)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jSeparator3,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)
.addComponent(jSeparator2,
javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 187,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(p3,
javax.swing.GroupLayout.PREFERRED_SIZE, 144,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel4)
.addComponent(jLabel5)
PAYROLL MANAGEMENT SYSTEM|

129

.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 75,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addComponent(p1,
javax.swing.GroupLayout.PREFERRED_SIZE, 144,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(p4,
javax.swing.GroupLayout.PREFERRED_SIZE, 144,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(p5,
javax.swing.GroupLayout.PREFERRED_SIZE, 144,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(p6,
javax.swing.GroupLayout.PREFERRED_SIZE, 144,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(29, 29, 29))
.addComponent(jSeparator1,
javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE))
.addGap(298, 298, 298))
.addGroup(layout.createSequentialGroup()
.addGap(270, 270, 270)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

PAYROLL MANAGEMENT SYSTEM|

130

.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(225, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10,
Short.MAX_VALUE)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(p2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jButton1)
.addComponent(jButton2))
.addGap(19, 19, 19)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE,
PAYROLL MANAGEMENT SYSTEM|

131

javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(2, 2, 2)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel4)
.addComponent(p4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)

PAYROLL MANAGEMENT SYSTEM|

132

.addComponent(p5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel7)
.addComponent(p6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel8)
.addComponent(p7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel11)
.addComponent(p8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
PAYROLL MANAGEMENT SYSTEM|

133

.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel12)
.addComponent(p9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel10)
.addComponent(p10, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jSeparator3,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(24, 24, 24))
);

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

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


// TODO add your handling code here:
}

PAYROLL MANAGEMENT SYSTEM|

134

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


String id=p2.getText().trim();
if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Valid
Employee Id ");
}
else

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement
ps=con.prepareStatement("select * from sal where id=?");
ps.setString(1,id);
ResultSet res=ps.executeQuery();
if(res.next())
{

p1.setText(res.getString(1).trim());

p3.setText(res.getString(4).trim());
p4.setText(res.getString(3).trim());
PAYROLL MANAGEMENT SYSTEM|

135

p5.setText(res.getString(5).trim());
p6.setText(res.getString(6).trim());
p7.setText(res.getString(7).trim());
p8.setText(res.getString(8).trim());
p9.setText(res.getString(9).trim());
p10.setText(res.getString(10).trim());
p2.setText(res.getString(2).trim());
}
else
{
JOptionPane.showMessageDialog(null,"Enter Valid
Employee Id");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

// TODO add your handling code here:


}

PAYROLL MANAGEMENT SYSTEM|

136

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


// TODO add your handling code here:
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
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.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JScrollBar jScrollBar1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JTextField p1;
private javax.swing.JTextField p10;
private javax.swing.JTextField p2;
PAYROLL MANAGEMENT SYSTEM|

137

wmrgNtRneoaPFsil
private javax.swing.JTextField p3;
private javax.swing.JTextField p4;
private javax.swing.JTextField p5;
private javax.swing.JTextField p6;
private javax.swing.JTextField p7;
private javax.swing.JTextField p8;
private javax.swing.JTextField p9;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

138

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* addpersonal.java
PAYROLL MANAGEMENT SYSTEM|

139

*
* Created on Jun 8, 2012, 12:56:39 AM
*/

package rol;
import java.sql.*;
import java.lang.String.*;
import javax.swing.JOptionPane;
/**
*
* @author Shubham Barnwal
*/
public class addpersonal extends javax.swing.JInternalFrame {

/** Creates new form addpersonal */


public addpersonal() {
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() {
PAYROLL MANAGEMENT SYSTEM|

140

buttonGroup1 = new javax.swing.ButtonGroup();


jInternalFrame1 = new javax.swing.JInternalFrame();
p8 = new javax.swing.JTextField();
p2 = new javax.swing.JTextField();
p4 = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
p1 = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
g1 = new javax.swing.JRadioButton();
p10 = new javax.swing.JTextField();
g2 = new javax.swing.JRadioButton();
p6 = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
p9 = new javax.swing.JTextArea();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel12 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
p11 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
PAYROLL MANAGEMENT SYSTEM|

141

jLabel7 = new javax.swing.JLabel();


jLabel6 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
p3 = new javax.swing.JTextField();
jLabel14 = new javax.swing.JLabel();
p5 = new javax.swing.JTextField();
p7 = new javax.swing.JComboBox();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(204, 51, 0)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

jInternalFrame1.setBorder(javax.swing.BorderFactory.createMatteBorder(1,
1, 1, 1, new java.awt.Color(204, 51, 0)));
jInternalFrame1.setClosable(true);
jInternalFrame1.setIconifiable(true);
jInternalFrame1.setTitle("College Mgmt System");
jInternalFrame1.setName("jInternalFrame1"); // NOI18N

javax.swing.GroupLayout jInternalFrame1Layout = new


javax.swing.GroupLayout(jInternalFrame1.getContentPane());
PAYROLL MANAGEMENT SYSTEM|

142

jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGap(0, 0, Short.MAX_VALUE)
);

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


p8.setForeground(new java.awt.Color(0, 0, 204));
p8.setName("p8"); // NOI18N

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


p2.setForeground(new java.awt.Color(0, 0, 204));
p2.setName("p2"); // NOI18N

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


p4.setForeground(new java.awt.Color(0, 0, 204));
p4.setName("p4"); // NOI18N

jLabel11.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel11.setForeground(new java.awt.Color(255, 255, 255));

PAYROLL MANAGEMENT SYSTEM|

143

jLabel11.setText("Email Id");
jLabel11.setName("jLabel11"); // NOI18N

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


p1.setForeground(new java.awt.Color(0, 0, 204));
p1.setName("p1"); // NOI18N

jLabel9.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel9.setForeground(new java.awt.Color(255, 255, 255));
jLabel9.setText("Post");
jLabel9.setName("jLabel9"); // NOI18N

jLabel10.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel10.setForeground(new java.awt.Color(255, 255, 255));
jLabel10.setText("Contact ");
jLabel10.setName("jLabel10"); // NOI18N

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


buttonGroup1.add(g1);
g1.setForeground(new java.awt.Color(0, 0, 204));
g1.setText("Male");
g1.setName("g1"); // NOI18N

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


p10.setForeground(new java.awt.Color(0, 0, 204));
p10.setName("p10"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

144

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


buttonGroup1.add(g2);
g2.setForeground(new java.awt.Color(0, 0, 204));
g2.setText("Female");
g2.setName("g2"); // NOI18N

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


p6.setForeground(new java.awt.Color(0, 0, 204));
p6.setModel(new javax.swing.DefaultComboBoxModel(new String[]
{ "Computer", "Management", "Science", "Eduction", "Forth Class", "Acount
Deptt" }));
p6.setName("p6"); // NOI18N

jScrollPane1.setName("jScrollPane1"); // NOI18N

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


p9.setColumns(20);
p9.setForeground(new java.awt.Color(0, 0, 204));
p9.setRows(5);
p9.setName("p9"); // NOI18N
jScrollPane1.setViewportView(p9);

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


jButton1.setText("Register");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
PAYROLL MANAGEMENT SYSTEM|

145

}
});

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


jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

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


jButton3.setText("Cancel");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jLabel12.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel12.setForeground(new java.awt.Color(255, 255, 255));
jLabel12.setText("Salary");
jLabel12.setName("jLabel12"); // NOI18N

jLabel1.setFont(new java.awt.Font("Garamond", 0, 24));


PAYROLL MANAGEMENT SYSTEM|

146

jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled6.png")); //
NOI18N
jLabel1.setText("

Add Profile");

jLabel1.setName("jLabel1"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Address");
jLabel8.setName("jLabel8"); // NOI18N

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


p11.setForeground(new java.awt.Color(0, 0, 204));
p11.setName("p11"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Gender");
jLabel5.setName("jLabel5"); // NOI18N

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Date of Birth");
jLabel4.setName("jLabel4"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Name");
PAYROLL MANAGEMENT SYSTEM|

147

jLabel3.setName("jLabel3"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Personnel Id");
jLabel2.setName("jLabel2"); // NOI18N

jLabel7.setFont(new java.awt.Font("Garamond", 0, 18));


jLabel7.setName("jLabel7"); // NOI18N

jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Department");
jLabel6.setName("jLabel6"); // NOI18N

jLabel13.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel13.setForeground(new java.awt.Color(255, 255, 255));
jLabel13.setText("Father's Name");
jLabel13.setName("jLabel13"); // NOI18N

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


p3.setForeground(new java.awt.Color(0, 0, 204));
p3.setName("p3"); // NOI18N

jLabel14.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel14.setForeground(new java.awt.Color(255, 255, 255));
jLabel14.setText("Date Of Joining");
PAYROLL MANAGEMENT SYSTEM|

148

jLabel14.setName("jLabel14"); // NOI18N

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


p5.setForeground(new java.awt.Color(0, 0, 204));
p5.setName("p5"); // NOI18N

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


p7.setForeground(new java.awt.Color(0, 0, 204));
p7.setModel(new javax.swing.DefaultComboBoxModel(new String[]
{ "Faculty", "Hod", "Clerk", "Registrar", "Fourt Class" }));
p7.setName("p7"); // NOI18N

jLabel15.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N


jLabel15.setForeground(new java.awt.Color(0, 255, 255));
jLabel15.setText("Kindly fill up the following details very carefully");
jLabel15.setName("jLabel15"); // NOI18N

jLabel16.setFont(new java.awt.Font("Aharoni", 0, 14));


jLabel16.setForeground(new java.awt.Color(0, 255, 255));
jLabel16.setText("The information once entered in the server can not be
altered afterwards.");
jLabel16.setName("jLabel16"); // NOI18N

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

149

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(183, 183, 183)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel12)
.addComponent(jLabel11))
.addGap(85, 85, 85)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(p11)
.addComponent(p10,
javax.swing.GroupLayout.PREFERRED_SIZE, 142,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel9,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
PAYROLL MANAGEMENT SYSTEM|

150

.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel14)
.addComponent(jLabel6)
.addComponent(jLabel13)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel10)
.addComponent(jLabel8))
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addGroup(layout.createSequentialGroup()
.addComponent(g1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG, false)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
.addComponent(p8,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(p7,
javax.swing.GroupLayout.Alignment.LEADING, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
PAYROLL MANAGEMENT SYSTEM|

151

.addComponent(p6,
javax.swing.GroupLayout.Alignment.LEADING, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(p5,
javax.swing.GroupLayout.Alignment.LEADING)))
.addGroup(layout.createSequentialGroup()
.addGap(40, 40, 40)
.addComponent(g2,
javax.swing.GroupLayout.PREFERRED_SIZE, 70,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(p3)
.addComponent(p2)
.addComponent(p1, javax.swing.GroupLayout.DEFAULT_SIZE,
121, Short.MAX_VALUE)
.addComponent(p4))))
.addGap(207, 207, 207)
.addComponent(jLabel7)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(63, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
593, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(61, 61, 61))
.addGroup(layout.createSequentialGroup()
.addGap(111, 111, 111)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 480,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(126, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

152

.addGap(146, 146, 146)


.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE,
130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
126, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE,
139, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(164, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(123, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(jSeparator2,
javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(jLabel15)
.addGap(77, 77, 77))
.addComponent(jLabel16,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGap(100, 100, 100))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

153

.addGap(0, 443, Short.MAX_VALUE)


.addComponent(jInternalFrame1,
javax.swing.GroupLayout.PREFERRED_SIZE, 0,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 274, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(245, 245, 245)
.addComponent(jLabel7)
.addGap(283, 283, 283))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(48, 48, 48)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel2)

PAYROLL MANAGEMENT SYSTEM|

154

.addComponent(p1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel3)
.addComponent(p2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(18, 18, 18)
PAYROLL MANAGEMENT SYSTEM|

155

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(g1)
.addComponent(g2,
javax.swing.GroupLayout.PREFERRED_SIZE, 23,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(p5,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(p6,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(p7,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(p8,
javax.swing.GroupLayout.PREFERRED_SIZE, 20,
javax.swing.GroupLayout.PREFERRED_SIZE))
PAYROLL MANAGEMENT SYSTEM|

156

.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jLabel14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel10)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel8)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 62,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p10,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

PAYROLL MANAGEMENT SYSTEM|

157

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(p11,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12,
javax.swing.GroupLayout.PREFERRED_SIZE, 20,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jButton1)
.addComponent(jButton2))
.addComponent(jButton3)))))
.addGroup(layout.createSequentialGroup()
.addGap(99, 99, 99)
.addComponent(jLabel15)
.addGap(1, 1, 1)
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(460, 460, 460)

PAYROLL MANAGEMENT SYSTEM|

158

.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(42, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(0, 346, Short.MAX_VALUE)
.addComponent(jInternalFrame1,
javax.swing.GroupLayout.PREFERRED_SIZE, 0,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 346, Short.MAX_VALUE)))
);

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

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

String id=p1.getText().trim();
if(id.length()==0) {
JOptionPane.showMessageDialog(null,"Enter ID");
return;
}
String name=p2.getText().trim();
if(name.length()==0) {
JOptionPane.showMessageDialog(null," Enter Name");
return;
PAYROLL MANAGEMENT SYSTEM|

159

}
String father=p3.getText().trim();
if(father.length()==0) {
JOptionPane.showMessageDialog(null," Enter Father Name");
return;
}
String date=p4.getText().trim();
if(date.length()==0) {
JOptionPane.showMessageDialog(null,"Enter Date of Birth");
return;
}
String gender;
if(g1.isSelected()) {
gender=g1.getText();
} else {
gender=g2.getText();
}
String jon=p5.getText().trim();
if(jon.length()==0) {
JOptionPane.showMessageDialog(null,"Date OF Joinig ");
return;
}
String dep=(String) p6.getSelectedItem();
if(dep.length()==0) {
JOptionPane.showMessageDialog(null,"Select Deptt");
return;
}
PAYROLL MANAGEMENT SYSTEM|

160

String post=(String) p7.getSelectedItem();


if(post.length()==0) {
JOptionPane.showMessageDialog(null,"Select Post");
return;
}
String contact=p8.getText().trim();
if(contact.length()==0) {
JOptionPane.showMessageDialog(null," Enter Contact no");
return;
}
String add=p9.getText().trim();
if(add.length()==0) {
JOptionPane.showMessageDialog(null,"Enter Address");
return;
}

String mail=p10.getText().trim();
if(mail.length()==0) {
JOptionPane.showMessageDialog(null,"Enter Mail Id");
return;
}
String sal=p11.getText().trim();
if(sal.length()==0) {
JOptionPane.showMessageDialog(null,"Enter Employee salary");
return;
}

PAYROLL MANAGEMENT SYSTEM|

161

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("insert into personal
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,id);
ps.setString(2,name);
ps.setString(3,father);
ps.setString(4,date);
ps.setString(5,gender);
ps.setString(6,jon);
ps.setString(7,dep);
ps.setString(8,post);
ps.setString(9,contact);
ps.setString(10,add);
ps.setString(11,mail);
ps.setString(12,sal);
int i=ps.executeUpdate();
if(i>0) {
JOptionPane.showMessageDialog(null,"Add Profile");
} else {
JOptionPane.showMessageDialog(null,"Not Add Profile");
}
} catch (Exception ex) {

PAYROLL MANAGEMENT SYSTEM|

162

JOptionPane.showMessageDialog(null, ex.toString());
}
// TODO add your handling code here:
}

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


p1.setText("");
p2.setText("");
p3.setText("");

p4.setText("");
p5.setText("");
p8.setText("");
p9.setText("");
p10.setText("");
p11.setText("");

// TODO add your handling code here:


}

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

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

PAYROLL MANAGEMENT SYSTEM|

163

// Variables declaration - do not modify


private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JRadioButton g1;
private javax.swing.JRadioButton g2;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
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.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
PAYROLL MANAGEMENT SYSTEM|

164

axTcuContFrmli
private javax.swing.JTextField p1;

private javax.swing.JTextField p10;


private javax.swing.JTextField p11;
private javax.swing.JTextField p2;
private javax.swing.JTextField p3;
private javax.swing.JTextField p4;
private javax.swing.JTextField p5;

private javax.swing.JComboBox p6;


private javax.swing.JComboBox p7;
private javax.swing.JTextField p8;
private javax.swing.JTextArea p9;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

165

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
PAYROLL MANAGEMENT SYSTEM|

166

* addtax.java
*
* Created on Jun 10, 2012, 2:46:43 PM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class addtax extends javax.swing.JInternalFrame {

/** Creates new form addtax */


public addtax() {
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">
PAYROLL MANAGEMENT SYSTEM|

167

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();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
s1 = new javax.swing.JTextField();
s2 = new javax.swing.JTextField();
s3 = new javax.swing.JTextField();
s4 = new javax.swing.JTextField();
s5 = new javax.swing.JTextField();
s6 = new javax.swing.JTextField();
s7 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();

setBackground(new java.awt.Color(102, 102, 102));


PAYROLL MANAGEMENT SYSTEM|

168

setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(153, 51, 0)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

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


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled7.png")); //
NOI18N
jLabel1.setText("

Calculate Tax");

jLabel1.setName("jLabel1"); // NOI18N

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


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Personnel Id");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Slip No.");
jLabel3.setName("jLabel3"); // NOI18N

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Personnel Name");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


PAYROLL MANAGEMENT SYSTEM|

169

jLabel5.setForeground(new java.awt.Color(255, 255, 255));


jLabel5.setText("Department");
jLabel5.setName("jLabel5"); // NOI18N

jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Post");
jLabel6.setName("jLabel6"); // NOI18N

jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("Total Annual Salary");
jLabel7.setName("jLabel7"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Total Tax");
jLabel8.setName("jLabel8"); // NOI18N

jTextField1.setText("jTextField1");
jTextField1.setName("jTextField1"); // NOI18N

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


s1.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s1.setForeground(new java.awt.Color(0, 51, 255));
s1.setName("s1"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

170

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


s2.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s2.setForeground(new java.awt.Color(0, 51, 255));
s2.setName("s2"); // NOI18N
s2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
s2ActionPerformed(evt);
}
});

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


s3.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s3.setForeground(new java.awt.Color(0, 51, 255));
s3.setName("s3"); // NOI18N
s3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
s3ActionPerformed(evt);
}
});

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


s4.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s4.setForeground(new java.awt.Color(0, 51, 255));
s4.setName("s4"); // NOI18N

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


s5.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

171

s5.setForeground(new java.awt.Color(0, 51, 255));


s5.setName("s5"); // NOI18N

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


s6.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s6.setForeground(new java.awt.Color(0, 51, 255));
s6.setName("s6"); // NOI18N

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


s7.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N
s7.setForeground(new java.awt.Color(0, 51, 255));
s7.setName("s7"); // NOI18N

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


jButton1.setText("Submit");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PAYROLL MANAGEMENT SYSTEM|

172

jButton2ActionPerformed(evt);
}
});

jButton5.setBackground(new java.awt.Color(204, 204, 204));


jButton5.setText("Calculate Tax");
jButton5.setName("jButton5"); // NOI18N
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});

jLabel9.setIcon(new javax.swing.ImageIcon("D:\\pay\\payroll-management727431.jpg")); // NOI18N


jLabel9.setText("jLabel9");
jLabel9.setName("jLabel9"); // NOI18N

jLabel10.setFont(new java.awt.Font("Aharoni", 0, 12)); // NOI18N


jLabel10.setForeground(new java.awt.Color(0, 255, 255));
jLabel10.setText("Kindly fill up the following details of personnel whose tax is
to be calculated:");
jLabel10.setName("jLabel10"); // NOI18N

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

173

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(39, 39, 39)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel9,
javax.swing.GroupLayout.PREFERRED_SIZE, 145,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(1, 1, 1)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 367,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel5)
.addComponent(jLabel4)
PAYROLL MANAGEMENT SYSTEM|

174

.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel3)
.addComponent(jLabel2))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG, false)
.addComponent(s3,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(s2,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(s1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
.addComponent(s5,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(s4,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
.addComponent(s6,
javax.swing.GroupLayout.PREFERRED_SIZE, 149,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 115,
Short.MAX_VALUE)
.addComponent(s7,
javax.swing.GroupLayout.PREFERRED_SIZE, 145,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13))
PAYROLL MANAGEMENT SYSTEM|

175

.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jSeparator2,
javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)
.addComponent(jButton5,
javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)))))
.addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 483,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(39, 39, 39)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(231, 231, 231)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG, false)
.addComponent(jButton1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 203,
javax.swing.GroupLayout.PREFERRED_SIZE))

PAYROLL MANAGEMENT SYSTEM|

176

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(30, 30, 30))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jLabel1)
.addGap(11, 11, 11)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE,
287, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3)
.addGap(8, 8, 8)
PAYROLL MANAGEMENT SYSTEM|

177

.addComponent(jLabel4)
.addGap(12, 12, 12)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel7))
.addGroup(layout.createSequentialGroup()
.addComponent(s1,
javax.swing.GroupLayout.PREFERRED_SIZE, 19,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(s2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(8, 8, 8)
.addComponent(s3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(s4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(s5,
javax.swing.GroupLayout.PREFERRED_SIZE,
PAYROLL MANAGEMENT SYSTEM|

178

javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(s6,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel8)
.addComponent(s7, javax.swing.GroupLayout.PREFERRED_SIZE,
19, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14,
Short.MAX_VALUE)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
PAYROLL MANAGEMENT SYSTEM|

179

.addComponent(jButton2)
.addGap(52, 52, 52))
);

layout.linkSize(javax.swing.SwingConstants.VERTICAL, new
java.awt.Component[] {s1, s2, s3, s4, s5, s6, s7});

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

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


// TODO add your handling code here:
}

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


// TODO add your handling code here:
}

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


Double cal,count;
String tax=s6.getText();
cal=Double.parseDouble(tax);
count=(cal/10);
String str=String.valueOf(count);
s7.setText(str);
// TODO add your handling code here:
}
PAYROLL MANAGEMENT SYSTEM|

180

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


String id=s1.getText().trim();
if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Eployee
id...");
return;
}
String slip=s2.getText().trim();
if(slip.length()==0)
{
JOptionPane.showMessageDialog(null," Enter Slip
no...");
return;
}
String name=s3.getText().trim();
if(name.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee Name..");
return;
}
String dept=s4.getText().trim();
if(dept.length()==0)
{
PAYROLL MANAGEMENT SYSTEM|

181

JOptionPane.showMessageDialog(null,"Enter
Employee dept");
return;
}

String post=s5.getText().trim();
if(post.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee post ");
return;
}

String sal=s6.getText().trim();
if(sal.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter
Employee Anual Salary ");
return;
}
String tax=s7.getText().trim();
if(tax.length()==0)
PAYROLL MANAGEMENT SYSTEM|

182

{
JOptionPane.showMessageDialog(null,"Calculate Tax
");
return;
}
else

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement
ps=con.prepareStatement("insert into tax values(?,?,?,?,?,?,?)");
ps.setString(1,id);
ps.setString(2,slip);
ps.setString(3,name);
ps.setString(4,dept);
ps.setString(5,post);
ps.setString(6,sal);
ps.setString(7,tax);

int i=ps.executeUpdate();
if(i>0)
{
PAYROLL MANAGEMENT SYSTEM|

183

JOptionPane.showMessageDialog(null,"Eployee Details
Add");
}
else
{
JOptionPane.showMessageDialog(null,"Record not
Save");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

}
// TODO add your handling code here:
}

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


s1.setText("");
s2.setText("");
s3.setText("");
s4.setText("");
s5.setText("");
s6.setText("");
s7.setText("");
// TODO add your handling code here:
PAYROLL MANAGEMENT SYSTEM|

184

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
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.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField s1;
private javax.swing.JTextField s2;
private javax.swing.JTextField s3;
private javax.swing.JTextField s4;
private javax.swing.JTextField s5;
private javax.swing.JTextField s6;
private javax.swing.JTextField s7;
PAYROLL MANAGEMENT SYSTEM|

185

DmnSeoayPFsrtl
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

186

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* removepay.java
*
PAYROLL MANAGEMENT SYSTEM|

187

* Created on Jun 10, 2012, 1:45:41 PM


*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author shubham
*/
public class removepay extends javax.swing.JInternalFrame {

/** Creates new form removepay */


public removepay() {
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() {

PAYROLL MANAGEMENT SYSTEM|

188

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
t1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(102, 0, 0)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

jLabel1.setFont(new java.awt.Font("Garamond", 0, 24));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled8.png")); //
NOI18N
jLabel1.setText("Remove Pay Details");
jLabel1.setName("jLabel1"); // NOI18N

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


jLabel2.setForeground(new java.awt.Color(0, 255, 255));
jLabel2.setText("Kindly enter the Personnel ID whose salary details are to be
deleted");
jLabel2.setName("jLabel2"); // NOI18N

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


t1.setFont(new java.awt.Font("Aharoni", 0, 14));
t1.setForeground(new java.awt.Color(0, 51, 204));
PAYROLL MANAGEMENT SYSTEM|

189

t1.setName("t1"); // NOI18N

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14));
jButton1.setText("Delete");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Cancel");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(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()
PAYROLL MANAGEMENT SYSTEM|

190

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 592,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 588,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(265, 265, 265)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(t1, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)
.addComponent(jButton1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap(26, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

191

.addGap(19, 19, 19)


.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
31, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(51, 51, 51)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(46, Short.MAX_VALUE))
);

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

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


String id=t1.getText().trim();
if(id.length()==0) {
JOptionPane.showMessageDialog(null,"ENTER username ");
}
else
PAYROLL MANAGEMENT SYSTEM|

192

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("delete from sal where id=?
");
ps.setString(1,id.trim());
int i=ps.executeUpdate();
if(i>0) {
JOptionPane.showMessageDialog(null,"Employee Pay Details
Remove");
} else {
JOptionPane.showMessageDialog(null,"Enter Valid Employee Id");
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString());
}
// TODO add your handling code here:
}

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


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

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
PAYROLL MANAGEMENT SYSTEM|

193

eDPsonmFrtl
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField t1;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

194

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* removepersonal.java
PAYROLL MANAGEMENT SYSTEM|

195

*
* Created on Jun 8, 2012, 12:57:19 AM
*/

package rol;
import java.sql.*;
import java.lang.String.*;
import javax.swing.JOptionPane;
/**
*
* @author Shubham Barnwal
*/
public class removepersonal extends javax.swing.JInternalFrame {

/** Creates new form removepersonal */


public removepersonal() {
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() {
PAYROLL MANAGEMENT SYSTEM|

196

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
s1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(153, 51, 0)));
setClosable(true);
setForeground(java.awt.Color.white);
setIconifiable(true);
setTitle("Payroll Management System");

jLabel1.setFont(new java.awt.Font("Garamond", 0, 18));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled9.png")); //
NOI18N
jLabel1.setText("

Remove Profile");

jLabel1.setName("jLabel1"); // NOI18N

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


jLabel2.setForeground(new java.awt.Color(0, 255, 255));
jLabel2.setText("Kindly enter the Personnel ID to be deleted");
jLabel2.setName("jLabel2"); // NOI18N

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


s1.setFont(new java.awt.Font("Aharoni", 0, 12));
PAYROLL MANAGEMENT SYSTEM|

197

s1.setForeground(new java.awt.Color(0, 51, 204));


s1.setName("s1"); // NOI18N

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


jButton1.setText("Remove");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Cancel");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(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()
PAYROLL MANAGEMENT SYSTEM|

198

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 592,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(138, 138, 138)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 375,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(283, 283, 283)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(s1, javax.swing.GroupLayout.DEFAULT_SIZE, 93,
Short.MAX_VALUE)
.addComponent(jButton1,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))))
.addContainerGap(26, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
PAYROLL MANAGEMENT SYSTEM|

199

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 64,


javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(s1, javax.swing.GroupLayout.DEFAULT_SIZE, 27,
Short.MAX_VALUE)
.addGap(32, 32, 32)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addGap(55, 55, 55))
);

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

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


String id=s1.getText().trim();
if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Employee
Id");
}
else

PAYROLL MANAGEMENT SYSTEM|

200

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("delete
from personal where id=?");
ps.setString(1,id.trim());
int i=ps.executeUpdate();
if(i>0)
{
JOptionPane.showMessageDialog(null,"Profile
Deleted");
}
else
{
JOptionPane.showMessageDialog(null,"Enter valid
Eployee ID");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());
}
// TODO add your handling code here:
}

PAYROLL MANAGEMENT SYSTEM|

201

eDamoxiFsTtrl

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

this.setVisible(false);

// TODO add your handling code here:

// 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.JTextField s1;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

202

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* removetax.java
*
PAYROLL MANAGEMENT SYSTEM|

203

* Created on Jun 10, 2012, 5:38:10 PM


*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class removetax extends javax.swing.JInternalFrame {

/** Creates new form removetax */


public removetax() {
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() {

PAYROLL MANAGEMENT SYSTEM|

204

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
t1 = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(0, 153, 0)));
setClosable(true);
setIconifiable(true);
setResizable(true);
setTitle("Payroll Management System");

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


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled18.png")); //
NOI18N
jLabel1.setText(" Remove Tax Details");
jLabel1.setName("jLabel1"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(0, 255, 255));
jLabel2.setText("Kindly enter the Personnel ID whose tax details are to be ");
jLabel2.setName("jLabel2"); // NOI18N

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


t1.setFont(new java.awt.Font("Aharoni", 0, 14));
PAYROLL MANAGEMENT SYSTEM|

205

t1.setForeground(new java.awt.Color(0, 51, 204));


t1.setName("t1"); // NOI18N

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


jButton2.setFont(new java.awt.Font("Tahoma", 1, 11));
jButton2.setText("Cancel");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14));
jButton1.setText("Delete");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(0, 255, 255));
jLabel3.setText("deleted permanently from your database ");
jLabel3.setName("jLabel3"); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

206

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(39, 39, 39)
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 528,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(113, 113, 113)
.addComponent(jLabel3)))
.addContainerGap(31, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILI
NG)
.addGroup(layout.createSequentialGroup()
.addGap(250, 250, 250)

PAYROLL MANAGEMENT SYSTEM|

207

.addComponent(t1, javax.swing.GroupLayout.DEFAULT_SIZE, 123,


Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addGap(246, 246, 246)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
127, Short.MAX_VALUE)))
.addGap(267, 267, 267))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(265, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(233, 233, 233))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(23, 23, 23)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(11, 11, 11)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

208

.addGap(41, 41, 41)


.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(38, Short.MAX_VALUE))
);

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

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


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

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


String id=t1.getText().trim();
if(id.length()==0) {
JOptionPane.showMessageDialog(null,"Enter Employee ID ");
} else
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("delete from tax where
id=? ");
PAYROLL MANAGEMENT SYSTEM|

209

ps.setString(1,id.trim());
int i=ps.executeUpdate();
if(i>0) {
JOptionPane.showMessageDialog(null,"Employee Tax Details
Remove");
} else {
JOptionPane.showMessageDialog(null,"Enter Valid Employee Id");
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString());
}
// TODO add your handling code here:
}

// 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 jLabel3;
private javax.swing.JTextField t1;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

210

eaSchPsonmFrl
PAYROLL MANAGEMENT SYSTEM|

211

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
PAYROLL MANAGEMENT SYSTEM|

212

* searchpersonal.java
*
* Created on Jun 10, 2012, 12:15:07 AM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class searchpersonal extends javax.swing.JInternalFrame {

/** Creates new form searchpersonal */


public searchpersonal() {
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">
PAYROLL MANAGEMENT SYSTEM|

213

private void initComponents() {

jLabel2 = new javax.swing.JLabel();


jLabel3 = new javax.swing.JLabel();
a1 = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
a4 = new javax.swing.JTextField();
a2 = new javax.swing.JTextField();
a3 = new javax.swing.JTextField();
jLabel14 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
a12 = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
a6 = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
a11 = new javax.swing.JTextArea();
jLabel12 = new javax.swing.JLabel();
a10 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
a13 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
a5 = new javax.swing.JTextField();
a7 = new javax.swing.JTextField();
PAYROLL MANAGEMENT SYSTEM|

214

a9 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(204, 0, 51)));
setClosable(true);
setForeground(java.awt.Color.white);
setIconifiable(true);
setTitle("Payroll Management System");

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


jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 255, 255));
jLabel2.setText("Kindly enter the Personnel ID whose details are to be
searched");
jLabel2.setName("jLabel2"); // NOI18N

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


jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Name");
PAYROLL MANAGEMENT SYSTEM|

215

jLabel3.setName("jLabel3"); // NOI18N

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


a1.setForeground(new java.awt.Color(0, 102, 255));
a1.setName("a1"); // NOI18N

jLabel11.setBackground(new java.awt.Color(255, 255, 255));


jLabel11.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel11.setForeground(new java.awt.Color(255, 255, 255));
jLabel11.setText("Email Id");
jLabel11.setName("jLabel11"); // NOI18N

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


a4.setForeground(new java.awt.Color(0, 102, 255));
a4.setName("a4"); // NOI18N

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


a2.setForeground(new java.awt.Color(0, 102, 255));
a2.setName("a2"); // NOI18N

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


a3.setForeground(new java.awt.Color(0, 102, 255));
a3.setName("a3"); // NOI18N

jLabel14.setBackground(new java.awt.Color(255, 255, 255));


jLabel14.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel14.setForeground(new java.awt.Color(255, 255, 255));
PAYROLL MANAGEMENT SYSTEM|

216

jLabel14.setText("Date Of Joining");
jLabel14.setName("jLabel14"); // NOI18N

jLabel6.setBackground(new java.awt.Color(255, 255, 255));


jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Department");
jLabel6.setName("jLabel6"); // NOI18N

jLabel13.setBackground(new java.awt.Color(255, 255, 255));


jLabel13.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel13.setForeground(new java.awt.Color(255, 255, 255));
jLabel13.setText("Father's Name");
jLabel13.setName("jLabel13"); // NOI18N

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


a12.setForeground(new java.awt.Color(0, 102, 255));
a12.setName("a12"); // NOI18N

jLabel9.setBackground(new java.awt.Color(255, 255, 255));


jLabel9.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel9.setForeground(new java.awt.Color(255, 255, 255));
jLabel9.setText("Post");
jLabel9.setName("jLabel9"); // NOI18N

jLabel10.setBackground(new java.awt.Color(255, 255, 255));


jLabel10.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

217

jLabel10.setForeground(new java.awt.Color(255, 255, 255));


jLabel10.setText("Contact ");
jLabel10.setName("jLabel10"); // NOI18N

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


a6.setForeground(new java.awt.Color(0, 102, 255));
a6.setName("a6"); // NOI18N

jScrollPane1.setName("jScrollPane1"); // NOI18N

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


a11.setColumns(20);
a11.setForeground(new java.awt.Color(0, 102, 255));
a11.setRows(5);
a11.setName("a11"); // NOI18N
jScrollPane1.setViewportView(a11);

jLabel12.setBackground(new java.awt.Color(255, 255, 255));


jLabel12.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel12.setForeground(new java.awt.Color(255, 255, 255));
jLabel12.setText("Salary");
jLabel12.setName("jLabel12"); // NOI18N

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


a10.setForeground(new java.awt.Color(0, 102, 255));
a10.setName("a10"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

218

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


jLabel1.setFont(new java.awt.Font("Garamond", 0, 24)); // NOI18N
jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled11.png")); //
NOI18N
jLabel1.setText("

Search Profile");

jLabel1.setName("jLabel1"); // NOI18N

jLabel8.setBackground(new java.awt.Color(255, 255, 255));


jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Address");
jLabel8.setName("jLabel8"); // NOI18N

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


a13.setForeground(new java.awt.Color(0, 102, 255));
a13.setName("a13"); // NOI18N

jLabel5.setBackground(new java.awt.Color(255, 255, 255));


jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Gender");
jLabel5.setName("jLabel5"); // NOI18N

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


jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Date of Birth");
PAYROLL MANAGEMENT SYSTEM|

219

jLabel4.setName("jLabel4"); // NOI18N

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


a5.setForeground(new java.awt.Color(0, 102, 255));
a5.setName("a5"); // NOI18N

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


a7.setForeground(new java.awt.Color(0, 102, 255));
a7.setName("a7"); // NOI18N

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


a9.setForeground(new java.awt.Color(0, 102, 255));
a9.setName("a9"); // NOI18N

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


jButton1.setText("Search");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
PAYROLL MANAGEMENT SYSTEM|

220

public void actionPerformed(java.awt.event.ActionEvent evt) {


jButton2ActionPerformed(evt);
}
});

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


jButton3.setText("Cancel");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jLabel7.setName("jLabel7"); // NOI18N

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

jSeparator3.setName("jSeparator3"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
PAYROLL MANAGEMENT SYSTEM|

221

.addGroup(layout.createSequentialGroup()
.addGap(28, 28, 28)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(30, 30, 30)
.addComponent(jLabel2))
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
591, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(29, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(299, 299, 299)
.addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE, 77,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(272, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(271, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE,
140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(237, 237, 237))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(173, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel3)
.addComponent(jLabel13)
PAYROLL MANAGEMENT SYSTEM|

222

.addComponent(jLabel4)
.addComponent(jLabel5))
.addGap(76, 76, 76)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)
.addComponent(a5, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(a4, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(a3, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(a2, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
.addGap(146, 146, 146))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(169, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE,
147, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(164, 164, 164))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(119, 119, 119)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G)
.addComponent(jSeparator3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE)

PAYROLL MANAGEMENT SYSTEM|

223

.addComponent(jSeparator2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(46, 46, 46)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel9)
.addComponent(jLabel14)
.addComponent(jLabel10)
.addComponent(jLabel8)
.addComponent(jLabel6)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel12)
.addComponent(jLabel11))))
.addGap(76, 76, 76)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G)

PAYROLL MANAGEMENT SYSTEM|

224

.addComponent(a12,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
.addComponent(a13,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)
.addComponent(a7,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(a6,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
.addComponent(a9,
javax.swing.GroupLayout.Alignment.LEADING)))
.addGap(49, 49, 49))
.addComponent(a10,
javax.swing.GroupLayout.PREFERRED_SIZE, 112,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jSeparator1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE))
.addGap(95, 95, 95))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
60, javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

225

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel7)
.addComponent(jLabel2))
.addGap(10, 10, 10)
.addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9)
.addComponent(jButton1)
.addGap(7, 7, 7)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel3)
.addComponent(a2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

226

.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 22,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(a3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(a4, javax.swing.GroupLayout.PREFERRED_SIZE,
20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(a5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(15, 15, 15)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G)
PAYROLL MANAGEMENT SYSTEM|

227

.addComponent(jLabel14)
.addComponent(a6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel8))
.addGroup(layout.createSequentialGroup()

PAYROLL MANAGEMENT SYSTEM|

228

.addComponent(a10, javax.swing.GroupLayout.PREFERRED_SIZE,
20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 62,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a12,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(a13, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12,
javax.swing.GroupLayout.PREFERRED_SIZE, 20,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addComponent(jSeparator3,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
PAYROLL MANAGEMENT SYSTEM|

229

.addComponent(jButton2)
.addComponent(jButton3))
.addContainerGap())
);

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

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


String id=a1.getText().trim();
if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Employee
Id");
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("select *
from personal where id=?");
ps.setString(1,id);
ResultSet res=ps.executeQuery();
if(res.next())
{

a2.setText(res.getString(2).trim());
PAYROLL MANAGEMENT SYSTEM|

230

a3.setText(res.getString(3).trim());
a4.setText(res.getString(4).trim());
a5.setText(res.getString(5).trim());
a6.setText(res.getString(6).trim());
a7.setText(res.getString(7).trim());
a9.setText(res.getString(8).trim());
a10.setText(res.getString(9).trim());
a11.setText(res.getString(10).trim());
a12.setText(res.getString(11).trim());
a13.setText(res.getString(12).trim());
a1.setText(res.getString(1).trim());

}
else
{
JOptionPane.showMessageDialog(null,"Id Not
Valid");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

}
PAYROLL MANAGEMENT SYSTEM|

231

// TODO add your handling code here:


}

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


a1.setText("");
a2.setText("");
a3.setText("");
a4.setText("");
a5.setText("");
a6.setText("");
a7.setText("");
a9.setText("");
a10.setText("");
a11.setText("");
a12.setText("");
a13.setText("");
// TODO add your handling code here:
}

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

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

PAYROLL MANAGEMENT SYSTEM|

232

// Variables declaration - do not modify


private javax.swing.JTextField a1;
private javax.swing.JTextField a10;
private javax.swing.JTextArea a11;
private javax.swing.JTextField a12;
private javax.swing.JTextField a13;
private javax.swing.JTextField a2;
private javax.swing.JTextField a3;
private javax.swing.JTextField a4;
private javax.swing.JTextField a5;
private javax.swing.JTextField a6;
private javax.swing.JTextField a7;
private javax.swing.JTextField a9;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
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;
PAYROLL MANAGEMENT SYSTEM|

233

eaShDmoxciFsTtrl
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;

private javax.swing.JScrollPane jScrollPane1;


private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

234

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* searchtax.java
PAYROLL MANAGEMENT SYSTEM|

235

*
* Created on Jun 10, 2012, 5:24:26 PM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class searchtax extends javax.swing.JInternalFrame {

/** Creates new form searchtax */


public searchtax() {
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() {
PAYROLL MANAGEMENT SYSTEM|

236

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();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
t1 = new javax.swing.JTextField();
t2 = new javax.swing.JTextField();
t3 = new javax.swing.JTextField();
t4 = new javax.swing.JTextField();
t5 = new javax.swing.JTextField();
t6 = new javax.swing.JTextField();
t7 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();

setBackground(new java.awt.Color(102, 102, 102));


setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

PAYROLL MANAGEMENT SYSTEM|

237

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


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled12.png")); //
NOI18N
jLabel1.setText("

Search Tax Details");

jLabel1.setName("jLabel1"); // NOI18N

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


jLabel2.setForeground(new java.awt.Color(0, 255, 255));
jLabel2.setText("Kindly enter the Personnel ID whose tax details are to be
searched");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Slip No.");
jLabel3.setName("jLabel3"); // NOI18N

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Personnel Name");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Department");
jLabel5.setName("jLabel5"); // NOI18N

jLabel6.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


PAYROLL MANAGEMENT SYSTEM|

238

jLabel6.setForeground(new java.awt.Color(255, 255, 255));


jLabel6.setText("Post");
jLabel6.setName("jLabel6"); // NOI18N

jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("Annual Salary");
jLabel7.setName("jLabel7"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18)); // NOI18N


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Tax");
jLabel8.setName("jLabel8"); // NOI18N

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


t1.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t1.setForeground(new java.awt.Color(0, 51, 204));
t1.setName("t1"); // NOI18N

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


t2.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t2.setForeground(new java.awt.Color(0, 51, 204));
t2.setName("t2"); // NOI18N

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


t3.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t3.setForeground(new java.awt.Color(0, 51, 204));
PAYROLL MANAGEMENT SYSTEM|

239

t3.setName("t3"); // NOI18N

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


t4.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t4.setForeground(new java.awt.Color(0, 51, 204));
t4.setName("t4"); // NOI18N

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


t5.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t5.setForeground(new java.awt.Color(0, 51, 204));
t5.setName("t5"); // NOI18N

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


t6.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t6.setForeground(new java.awt.Color(0, 51, 204));
t6.setName("t6"); // NOI18N

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


t7.setFont(new java.awt.Font("Aharoni", 0, 14)); // NOI18N
t7.setForeground(new java.awt.Color(0, 51, 204));
t7.setName("t7"); // NOI18N

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


jButton1.setText("Search");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PAYROLL MANAGEMENT SYSTEM|

240

jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

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


jButton3.setText("Cancel");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

241

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
592, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(29, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(83, 83, 83)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)
.addComponent(jSeparator1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
.addComponent(jLabel2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jSeparator2,
javax.swing.GroupLayout.Alignment.LEADING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38,
javax.swing.GroupLayout.PREFERRED_SIZE))
PAYROLL MANAGEMENT SYSTEM|

242

.addGroup(layout.createSequentialGroup()
.addGap(103, 103, 103)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(t7)
.addComponent(t6)
.addComponent(t5)
.addComponent(t4)
.addComponent(t3)
.addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE,
102, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(190, 190, 190)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)

PAYROLL MANAGEMENT SYSTEM|

243

.addComponent(jButton1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(t1, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 77,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 226,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)))
.addGap(75, 75, 75))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
57, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

244

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addGap(7, 7, 7)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel3)
.addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel4)
.addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(jLabel6))
.addGroup(layout.createSequentialGroup()
PAYROLL MANAGEMENT SYSTEM|

245

.addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(t5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(18, 18, 18)
.addComponent(jLabel8))
.addGroup(layout.createSequentialGroup()
.addComponent(t6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(t7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(13, 13, 13)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(8, 8, 8)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

PAYROLL MANAGEMENT SYSTEM|

246

.addComponent(jButton3)
.addGap(51, 51, 51))
);

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

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

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

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


t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
t6.setText("");
t7.setText("");
// TODO add your handling code here:
}

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

String id=t1.getText().trim();
PAYROLL MANAGEMENT SYSTEM|

247

if(id.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter Employee
Id");
}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("select *
from tax where id=?");
ps.setString(1,id);
ResultSet res=ps.executeQuery();
if(res.next())
{

t2.setText(res.getString(1).trim());
t3.setText(res.getString(2).trim());
t4.setText(res.getString(3).trim());
t5.setText(res.getString(4).trim());
t6.setText(res.getString(5).trim());
t7.setText(res.getString(6).trim());
t1.setText(res.getString(7).trim());

}
else
PAYROLL MANAGEMENT SYSTEM|

248

{
JOptionPane.showMessageDialog(null,"Id Not
Valid");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

}
// TODO add your handling code here:
}

// 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.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JSeparator jSeparator1;
PAYROLL MANAGEMENT SYSTEM|

249

haCngePsdwomFr
private javax.swing.JSeparator jSeparator2;
private javax.swing.JTextField t1;
private javax.swing.JTextField t2;
private javax.swing.JTextField t3;
private javax.swing.JTextField t4;
private javax.swing.JTextField t5;
private javax.swing.JTextField t6;
private javax.swing.JTextField t7;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

250

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* updatepass.java
PAYROLL MANAGEMENT SYSTEM|

251

*
* Created on Jun 6, 2012, 7:06:15 AM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class updatepass extends javax.swing.JFrame {

/** Creates new form updatepass */


public updatepass() {
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() {
PAYROLL MANAGEMENT SYSTEM|

252

jPanel1 = new javax.swing.JPanel();


jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
s1 = new javax.swing.JTextField();
s2 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("PayRoll System");

jPanel1.setBackground(new java.awt.Color(102, 102, 102));


jPanel1.setForeground(new java.awt.Color(51, 0, 51));
jPanel1.setName("jPanel1"); // NOI18N

jLabel1.setFont(new java.awt.Font("Elephant", 0, 18));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled13.png")); //
NOI18N
jLabel1.setText("Upddate User Password");
jLabel1.setName("jLabel1"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

253

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("User Name");
jLabel2.setName("jLabel2"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Password");
jLabel3.setName("jLabel3"); // NOI18N

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


s1.setFont(new java.awt.Font("Aharoni", 0, 14));
s1.setForeground(new java.awt.Color(0, 0, 153));
s1.setName("s1"); // NOI18N

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


s2.setFont(new java.awt.Font("Aharoni", 0, 14));
s2.setForeground(new java.awt.Color(0, 0, 153));
s2.setName("s2"); // NOI18N
s2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
s2ActionPerformed(evt);
}
});

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


jButton1.setFont(new java.awt.Font("Garamond", 1, 14));
PAYROLL MANAGEMENT SYSTEM|

254

jButton1.setText("Update");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setFont(new java.awt.Font("Garamond", 1, 14));
jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jLabel5.setFont(new java.awt.Font("Garamond", 1, 24));


jLabel5.setIcon(new
javax.swing.ImageIcon("D:\\pay\\payroll_management_02_5.jpg")); // NOI18N
jLabel5.setText("PayRoll Mgmt System");
jLabel5.setName("jLabel5"); // NOI18N

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


jButton3.setText("Back");
jButton3.setName("jButton3"); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

255

jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

javax.swing.GroupLayout jPanel1Layout = new


javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 140,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42,
Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 142,
javax.swing.GroupLayout.PREFERRED_SIZE)
PAYROLL MANAGEMENT SYSTEM|

256

.addGap(33, 33, 33)


.addComponent(jButton3,
javax.swing.GroupLayout.PREFERRED_SIZE, 147,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jSeparator2,
javax.swing.GroupLayout.DEFAULT_SIZE, 504, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(111, 111, 111)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 308,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(59, 59, 59)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
TRAILING, false)
.addComponent(jSeparator1,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 419, Short.MAX_VALUE))
.addContainerGap(46, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(131, 131, 131)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
155, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
125, javax.swing.GroupLayout.PREFERRED_SIZE))

PAYROLL MANAGEMENT SYSTEM|

257

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
TRAILING)
.addComponent(s2, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 122,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(s1, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 122,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(112, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
BASELINE)

PAYROLL MANAGEMENT SYSTEM|

258

.addComponent(s1, javax.swing.GroupLayout.PREFERRED_SIZE, 25,


javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
30, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
BASELINE)
.addComponent(s2, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
27, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
BASELINE)
.addComponent(jButton1)
.addComponent(jButton3,
javax.swing.GroupLayout.PREFERRED_SIZE, 26,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 26,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(25, Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
PAYROLL MANAGEMENT SYSTEM|

259

getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);

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

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


// TODO add your handling code here:
}

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


String uname=s1.getText().trim();
if(uname.length()==0)
{
JOptionPane.showMessageDialog(null,"Enter User Name");
}
try

PAYROLL MANAGEMENT SYSTEM|

260

{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("update log set upass=?
where uname=?");

ps.setString(1,s2.getText().trim());
ps.setString(2,s1.getText().trim());
int i=ps.executeUpdate();
if(i>0) {
JOptionPane.showMessageDialog(null,"User Password Updated");
} else
{
JOptionPane.showMessageDialog(null,"User Not present Data Base");
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString());

}
// TODO add your handling code here:
}

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


s1.setText("");
s2.setText("");
PAYROLL MANAGEMENT SYSTEM|

261

// TODO add your handling code here:


}

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


this.setVisible(false);
LogIn lo =new LogIn();
lo.setVisible(true);
// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new updatepass().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;
PAYROLL MANAGEMENT SYSTEM|

262

pdUateSryFoml
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel5;

private javax.swing.JPanel jPanel1;

private javax.swing.JSeparator jSeparator1;


private javax.swing.JSeparator jSeparator2;
private javax.swing.JTextField s1;

private javax.swing.JPasswordField s2;


// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

263

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

PAYROLL MANAGEMENT SYSTEM|

264

/*
* updatepay.java
*
* Created on Jun 10, 2012, 8:14:41 AM
*/

package rol;
import java.sql.*;
import javax.swing.JOptionPane;
import java.lang.String.*;
/**
*
* @author Shubham Barnwal
*/
public class updatepay extends javax.swing.JInternalFrame {

/** Creates new form updatepay */


public updatepay() {
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")
PAYROLL MANAGEMENT SYSTEM|

265

// <editor-fold defaultstate="collapsed" desc="Generated Code">


private void initComponents() {

jLabel1 = new javax.swing.JLabel();


a8 = new javax.swing.JTextField();
a7 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
a9 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
a10 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
a3 = new javax.swing.JTextField();
a2 = new javax.swing.JTextField();
a4 = new javax.swing.JTextField();
a5 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
a1 = new javax.swing.JTextField();
jButton4 = new javax.swing.JButton();
PAYROLL MANAGEMENT SYSTEM|

266

a6 = new javax.swing.JTextField();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();

setBackground(new java.awt.Color(102, 102, 102));


setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new
java.awt.Color(153, 0, 51)));
setClosable(true);
setIconifiable(true);
setTitle("Payroll Management System");

jLabel1.setFont(new java.awt.Font("Garamond", 1, 18));


jLabel1.setIcon(new javax.swing.ImageIcon("D:\\pay\\Untitled14.png")); //
NOI18N
jLabel1.setText("

Update Monthly Pay Details");

jLabel1.setName("jLabel1"); // NOI18N

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


a8.setFont(new java.awt.Font("Aharoni", 0, 14));
a8.setForeground(new java.awt.Color(0, 51, 204));
a8.setName("a8"); // NOI18N

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


a7.setFont(new java.awt.Font("Aharoni", 0, 14));
a7.setForeground(new java.awt.Color(0, 51, 204));
a7.setName("a7"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

267

jLabel4.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel4.setForeground(new java.awt.Color(255, 255, 255));
jLabel4.setText("Personnel Name");
jLabel4.setName("jLabel4"); // NOI18N

jLabel5.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Post");
jLabel5.setName("jLabel5"); // NOI18N

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


a9.setFont(new java.awt.Font("Aharoni", 0, 14));
a9.setForeground(new java.awt.Color(0, 51, 204));
a9.setName("a9"); // NOI18N

jLabel2.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("Enter Personnel ID");
jLabel2.setName("jLabel2"); // NOI18N

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


a10.setFont(new java.awt.Font("Aharoni", 0, 14));
a10.setForeground(new java.awt.Color(0, 51, 204));
a10.setName("a10"); // NOI18N

jLabel3.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel3.setForeground(new java.awt.Color(255, 255, 255));
PAYROLL MANAGEMENT SYSTEM|

268

jLabel3.setText("Slip No.");
jLabel3.setName("jLabel3"); // NOI18N

jLabel7.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("No. Of Working Days");
jLabel7.setName("jLabel7"); // NOI18N

jLabel8.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Month");
jLabel8.setName("jLabel8"); // NOI18N

jLabel9.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel9.setForeground(new java.awt.Color(255, 255, 255));
jLabel9.setText("Salary");
jLabel9.setName("jLabel9"); // NOI18N

jLabel10.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel10.setForeground(new java.awt.Color(255, 255, 255));
jLabel10.setText("Total Salary");
jLabel10.setName("jLabel10"); // NOI18N

jLabel11.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel11.setForeground(new java.awt.Color(255, 255, 255));
jLabel11.setText("DA");
jLabel11.setName("jLabel11"); // NOI18N
PAYROLL MANAGEMENT SYSTEM|

269

jLabel12.setFont(new java.awt.Font("Aharoni", 0, 18));


jLabel12.setForeground(new java.awt.Color(255, 255, 255));
jLabel12.setText("HRA");
jLabel12.setName("jLabel12"); // NOI18N

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


a3.setFont(new java.awt.Font("Aharoni", 0, 14));
a3.setForeground(new java.awt.Color(0, 51, 204));
a3.setName("a3"); // NOI18N

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


a2.setFont(new java.awt.Font("Aharoni", 0, 14));
a2.setForeground(new java.awt.Color(0, 51, 204));
a2.setName("a2"); // NOI18N
a2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
a2ActionPerformed(evt);
}
});

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


a4.setFont(new java.awt.Font("Aharoni", 0, 14));
a4.setForeground(new java.awt.Color(0, 51, 204));
a4.setName("a4"); // NOI18N

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


PAYROLL MANAGEMENT SYSTEM|

270

a5.setFont(new java.awt.Font("Aharoni", 0, 14));


a5.setForeground(new java.awt.Color(0, 51, 204));
a5.setName("a5"); // NOI18N

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


jButton1.setText("Update");
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

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


jButton2.setText("Reset");
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

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


jButton3.setText("Cancel");
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PAYROLL MANAGEMENT SYSTEM|

271

jButton3ActionPerformed(evt);
}
});

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


a1.setFont(new java.awt.Font("Aharoni", 0, 14));
a1.setForeground(new java.awt.Color(0, 51, 204));
a1.setName("a1"); // NOI18N

jButton4.setBackground(new java.awt.Color(204, 204, 204));


jButton4.setText("Calculate Total Salary");
jButton4.setName("jButton4"); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});

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


a6.setFont(new java.awt.Font("Aharoni", 0, 14));
a6.setForeground(new java.awt.Color(0, 51, 204));
a6.setName("a6"); // NOI18N

jSeparator1.setName("jSeparator1"); // NOI18N

jSeparator2.setName("jSeparator2"); // NOI18N

PAYROLL MANAGEMENT SYSTEM|

272

jSeparator3.setName("jSeparator3"); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(185, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE,
139, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
127, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE,
129, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(135, 135, 135))
.addGroup(layout.createSequentialGroup()
.addGap(50, 50, 50)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
591, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(86, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(150, Short.MAX_VALUE)

PAYROLL MANAGEMENT SYSTEM|

273

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel9)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 159,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 82,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel8))
.addGap(42, 42, 42))
.addComponent(jLabel11)
.addComponent(jLabel12)
.addComponent(jLabel10)
.addComponent(jLabel7))
.addGap(158, 158, 158)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G, false)
.addComponent(a10)
.addComponent(a9)
.addComponent(a8)
.addComponent(a7)
.addComponent(a6)
PAYROLL MANAGEMENT SYSTEM|

274

.addComponent(a5)
.addComponent(a4)
.addComponent(a3)
.addComponent(a2)
.addComponent(a1, javax.swing.GroupLayout.DEFAULT_SIZE, 114,
Short.MAX_VALUE))
.addContainerGap(104, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(212, Short.MAX_VALUE)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE,
317, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(198, 198, 198))
.addGroup(layout.createSequentialGroup()
.addGap(117, 117, 117)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILIN
G, false)
.addComponent(jSeparator3,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator2,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE))
.addContainerGap(105, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()

PAYROLL MANAGEMENT SYSTEM|

275

.addGap(32, 32, 32)


.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
59, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
PAYROLL MANAGEMENT SYSTEM|

276

.addComponent(a4, javax.swing.GroupLayout.PREFERRED_SIZE, 19,


javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a5, javax.swing.GroupLayout.PREFERRED_SIZE, 19,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a6, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a7, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addGap(18, 18, 18)
PAYROLL MANAGEMENT SYSTEM|

277

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(a9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 2,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton4)
.addGap(13, 13, 13)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jLabel10)
.addComponent(a10, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3)

PAYROLL MANAGEMENT SYSTEM|

278

.addComponent(jSeparator3,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(jButton3)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(26, Short.MAX_VALUE))
);

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

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


// TODO add your handling code here:
}

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


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

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


String id=a1.getText().trim();
if(id.length()==0)
{
PAYROLL MANAGEMENT SYSTEM|

279

JOptionPane.showMessageDialog(null,"Enter Employee Id");


}
else
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:pay");
PreparedStatement ps=con.prepareStatement("update
sal set
slipno=?,name=?,post=?,month=?,workingday=?,salary=?,da=?,hra=?,totalsal=?
where id=?");

ps.setString(1,a2.getText().trim());
ps.setString(2,a3.getText().trim());
ps.setString(3,a4.getText().trim());
ps.setString(4,a5.getText().trim());
ps.setString(5,a6.getText().trim());
ps.setString(6,a7.getText().trim());
ps.setString(7,a8.getText().trim());
ps.setString(8,a9.getText().trim());
ps.setString(9,a10.getText().trim());
ps.setString(10,a1.getText().trim());

int i=ps.executeUpdate();
if(i>0)
{
PAYROLL MANAGEMENT SYSTEM|

280

JOptionPane.showMessageDialog(null,"Pay
details UPdate");
}
else
{
JOptionPane.showMessageDialog(null,"Entet Valid
Employee id");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null,ex.toString());

}
// TODO add your handling code here:
}

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

int d,h,s,sum;
String sal=a7.getText();
String da=a8.getText();
String hra=a9.getText();
d=Integer.parseInt(da);
h=Integer.parseInt(hra);
s=Integer.parseInt(sal);
sum=(d+h+s);
PAYROLL MANAGEMENT SYSTEM|

281

String str=String.valueOf(sum);
a10.setText(str);
// TODO add yourhandling code here:
}

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


a1.setText("");
a2.setText("");
a3.setText("");
a4.setText("");
a5.setText("");
a6.setText("");
a7.setText("");
a8.setText("");
a9.setText("");a10.setText("");

// TODO add your handling code here:


}

// Variables declaration - do not modify


private javax.swing.JTextField a1;
private javax.swing.JTextField a10;
private javax.swing.JTextField a2;
PAYROLL MANAGEMENT SYSTEM|

282

private javax.swing.JTextField a3;


private javax.swing.JTextField a4;
private javax.swing.JTextField a5;
private javax.swing.JTextField a6;
private javax.swing.JTextField a7;
private javax.swing.JTextField a8;
private javax.swing.JTextField a9;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
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.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
// End of variables declaration

PAYROLL MANAGEMENT SYSTEM|

283

TESING
}

PAYROLL MANAGEMENT SYSTEM|

284

CONLUSI
The aim of the problem is to identify all defects existing in a software product.
However, for the most practical system, ever after satisfactorily carrying out
the testing phase, IT is not possible to guarantee that the software is error
free. This is because of the fact that the input domain is very large, it is not
practical to test the software exhaustively with respect to each value that the
input data may assume even with this practical limitation of the testing
process, we should not underestimate the importance of testing . We must
remember that testing does expose many defects existing in a software
product. Therefore, we can safely conclude that the testing provides a
practical way of reducing defect in a system and increasing the users
confidence in a developed system.

This is a project for PAYROLL MANAGEMENT SYSTEM it is a dummy project


because due to the deficiency of actual information about Regulation.
PAYROLL MANAGEMENT SYSTEM|

285

UTFRENHACMS
Our Project can be extended we are unable to work more on this now because of
lack of time. We will work more on it after some time we can make it useful for
many other Regulation. We can add some sorting method in it. We also add some
other facilities which help in it. We also can add some other facilities which help
in formatting students enquiry. We can extend it for making records of marks etc.
If we done this work also in our project we can sell it in market even as a self
package.
ADVANTAGES

It is fast, efficient and reliable

Avoids data redundancy and inconsistency

Very user-friendly

Easy accessibility of data

Number of personnel required is considerably less

Provides more security and integrity to data

The proposed system is PAYROLL Management System. We can enhance this

system by including more facilities like billing system,adding more than one

PAYROLL MANAGEMENT SYSTEM|

286

IBLOGRAPHY
distributors of same company,adding more handsets of other companies other than
added ones.

Providing such features enable the users to include more comments into the
system.

Below are the references used in designing the project:

Database concept
BY HENRY KORTH & ABHRAHAM SIBERSCHATZ

Programming with java by E Balaguruswamy

PAYROLL MANAGEMENT SYSTEM|

287

The Complete Refrence by Herbert Schildt

Web Technology by Rashmi Sharma

Database Programming with JDBC and Java by O'Reilly

Head First Java 2nd Edition

Java and Software Design Concepts by APress

Site Address

www.associatedcontent.com

www.members.tripod.com

http://www.jdbc-tutorial.com/

http://www.javaworld.com/javaworld/jw-01-1998/jw-01-bookreview.html

www.vbcodesource.com
PAYROLL MANAGEMENT SYSTEM|

288

PAYROLL MANAGEMENT SYSTEM|

289

Potrebbero piacerti anche