mca project report on java studio

233
Employee Transfer Management System Title of Project The studied project is related to the management of employees transfer record. It is titled as EMPLOYEE TRANSFER MANAGEMENT SYSTEM1

Upload: manojrhr

Post on 27-Apr-2015

547 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: MCA Project Report on JAVA Studio

Employee Transfer Management System

Title of Project

The studied project is related to the management of employees

transfer record. It is titled as

“EMPLOYEE TRANSFER MANAGEMENT SYSTEM”

1

Page 2: MCA Project Report on JAVA Studio

Employee Transfer Management System

1. INTRODUCTION

The computer has brought revolution in every sphere of human life,

whether it is business, education field, governance, medical science etc. The

computer has reduced the human work load, businesses are going global and every

thing is available at the click of mouse.

In any organisation top management is using computer in almost every

department. Human Resource Department is also a very important department of

every organisation, whether it is public or private. All needs to record their

employee related details, like their general information, pay related details and

details of transfer to other departments. I hear and see most of application working

in this field except any application which will trace employee transfer details and

generate his/her transfer related documents.

So that I am developing an application for maintaining information related

to Employees transfer and generating the transfer related documents. This

application would be facilitating the Human Resource Department (Higher

Management) to

Search the employee

Make new transfers

Update records

2

Page 3: MCA Project Report on JAVA Studio

Employee Transfer Management System

2. OBJECTIVES

Employee Transfer Management System is concerned with managing

employee’s transfer related records. Currently this is maintained manually by

Browse Wire IT Solutions in Joining/Transfer Registers. Salary registers, all the

documents required by the employee at the time of transfer and other reports

related to transfer are maintained and generated manually, which is a time

consuming process and is prone to errors.

The existing system at the organisations is manual and hence not

integrated. Many problems have arisen because of the manual system. But by

implementing our developed system, the organization can have the following

benefits;

Our system will decrease the complexity of Human Resource Department

to trace employees details which are transferred to other location.

An employee can submit his/her request for transfer.

Department can generate employees transfer related documents.

This system have good management of data, along with integrity and

minimizing redundancy

This system is user friendly in all possible ways.

The new system provides easier work than existing system for the Human

Resource Department.

The new system is secure system, that can be accessed only by authorised

users.

3

Page 4: MCA Project Report on JAVA Studio

Employee Transfer Management System

3. TOOLS AND PLATFORM

Today we have huge no. of technologies used for software development

these are C, C++, VC++, Java and Visual Basic etc. as front end and MS Access,

MS SQL, Oracle etc as back end tools

But Java Studio Creator and MS SQL Server 2005 are the technologies

that I am going to use as front end and back end respectively in my Project.

I have chosen Java Studio Creator for Front end because it provide quick

software development, it support ActiveX tools, and it also provides quick error

detection and correction and I choose MS SQL server 2005 since it require less

system requirement than Oracle.

System Requirement:-

Operating System : Any Operating System

Software Requirement : Java Virtual Machine, SQL Server 2005

CPU : Celeron or higher

RAM : 128 MB or higher

Hard Disk Space : 1 GB Free.

4

Page 5: MCA Project Report on JAVA Studio

Employee Transfer Management System

4. MODULES DESCIPTION

There are mainly two modules in the proposed project which will

interact with this project. Which are described below,

ADMINISTRATOR

In this module administrator is the person with all administrative

privileges, of the system, who can update, create and accept any enquiry

related to the employee transfer. An administrator will also generate

different documents related to the employee transfer.

EMPLOYEE

This is the second module of this project which is related to the

employee. This module have restricted access to the system. In this module

an employee can submit his/her request for transfer and will be able to

search any transfer related details but would not be authorised to edit or

update the details.

5

Page 6: MCA Project Report on JAVA Studio

Employee Transfer Management System

5. ANALYSIS

Problem Definition

Whenever, the problem is visualized, it is not the same as it appears. But

there are some other aspects also that come into the picture only after a sharp and

deep study of the problem.

This phase of system development is of great importance because it is must,

for a system analyst it is necessary to have a deep knowledge of the topic on which

he is working. The survey conducted by me, helps me to discover problems and

challenges in path of successful development of this system.

The current system is difficult to manage, not easily searchable, hard to

maitain, as there is enormouos amount of data handling involved in transfer

management. All this information are stored in various registers. All information is

handled manually which is really tedious and error prone. There is no organised

manner to perform the transfer related functions, resulting in redundant and

ambiguous data. So my goal is to provide an organized method for different

entities to be able to access and modify this data.

The Exisiting System

Under the existing system Browse Wire IT Solutions uses the mannually

prepared database for the employee records. The manually preparation of the data

on the register is really tedious and error prone. Staff manageement and transfer

management is not easy through this system.

Problems Faced by the Current System

Information is stored in written in form of registers. This has many

disadvantages, like checking a record in a register takes more time.

Registers require more space.

6

Page 7: MCA Project Report on JAVA Studio

Employee Transfer Management System

Retrieving information from registers is more difficult, like if want

to know at what day the employee was transferred in particular

department or office etc.

It is difficult to find and modify exisitng records.

Current system being manual is more error prone.

Proposed System

Main objectives of the project are:

1. Approval for the requested transfer.

2. Updating the transfer records.

3. Making new transfers.

4. Generate transfer letters.

5. Generate various reports like Employees transferred in

particular month / time span; transfers happened for

particular projects etc.

Software Engineering Approach

The goal of software engineering is to provide models that lead to the

production of well documented software in a manner that is predictable. For a

mature process, it should be possible to determine in advance how much time and

effort will be required to produce the final product.

To develop the software successfully I have used the Waterfall Model

(Classic Life Cycle). In this model first of all the existed system is observed. Then

customer requirements are taken in consideration then planning, modeling,

construction and finally deployment.

7

Page 8: MCA Project Report on JAVA Studio

Employee Transfer Management System

Fig.1. Waterfall Model

Developers Role & Responsibilities

Gathers and analyze data for developing information systems. Responsible

for studying problems in the existing system and recognizing needs for the new

system.

To design and develop the proposed system to solve the problem with the

existing system, the developer is responsible for the following events:

Evaluates project for feasibility.

Analyses current systems for problems and opportunities.

Defines requirements for improving the system.

Design system interface, flow and procedure.

Performs interviews and data gathering.

Evaluates technological possibilities for technical, operational and

economic feasibility.

Designs file and database structure.

Designs user interfaces (input/output) to computer system.

Designs data collection forms and technique.

Developing the system.

Installing the s/w on the client’s system(s).

8

Page 9: MCA Project Report on JAVA Studio

Employee Transfer Management System

Conducting any user training that might be necessary for using the

system.

Maintaining the system after installing.

Feasibility Study

In feasibility study we analyze our proposed solution for being feasible or

not. Under this we take into consideration three types of feasibility studies.

Behavioral Feasibility

Technical Feasibility

Economic Feasibility

Behavioral Feasibility

The Browse Wire IT Solutions is very much keen of implementation of

computerized Employee Transfer Management System as it would reduce their

workload. So in behavior point of view our solution is feasible.

Technical Feasibility

All the necessary resources (Hardware and Software) have been gathered

that are necessary for development of the proposed system. The Browse Wire IT

Solutions is ready to adopt new system and to upgrade existing system. Therefore,

the system is technically very much feasible.

Economic Feasibility

Since the computerization of Employee Transfer Management System of

Browse Wire IT Solutions is given as a project for me, which is necessary for my

course completion. The Browse Wire IT Solutions should not have to pay for this

therefore it is economically feasible.

Cost/Benefit Analysis

Since project preparation is compulsory for the completion of our

programme. So this project is given as the course completion subject. Therefore it

is free for the Browse Wire IT Solutions.

9

Page 10: MCA Project Report on JAVA Studio

Employee Transfer Management System

Information Gathering

Information gathering is an art and a science. The approach and the manner

in which information is gathered require persons with sensitivity and common

sense and knowledge of what information is to gather and when to gather. There

are many methods to gather the information. Before applying these methods the

analyst has to be familiar with current system.

Familiarity with the present system can be achieved through available

documentation such as procedures manuals, documents and their flow:

1. Interviews

2. Questionnaires

I went to Browse Wire IT Solutionsand conducted the above tasks. After

collecting the required information I drafted the following DFD’s. In Data Flow

Diagrams I describe the flow process of data in the system. For each process we

have created different DFD.

Structured Analysis

The structured analysis includes the set of techniques and graphical

representation of the candidate system that are easily understandable by the user. In

my project I undergo with DFD (Data Flow Diagram).

Data Flow Diagram:

A data flow diagram is graphical representation that depicts information

flow and the transforms that are applied as data move from input to output. The

basic form of data flow diagram is also known as data flow graph or bubble chart.

The data flow diagram may be used to represent a system or software at

any level of abstraction. The data flow diagram may be partitioned into levels that

represent increasing information flow and functional details. Therefore, the DFDs

provide a mechanism for functional modeling as well as information flow

10

Page 11: MCA Project Report on JAVA Studio

Employee Transfer Management System

modeling. In doing so, it satisfies the second operational analysis principle (i.e.

creating a functional model).

At level 0 DFD, also fundamental system model or a context model,

represents the entire software element as single bubble with input and output data

indicated by incoming & outgoing arrows respectively. Additional bubble and

information flow paths are represented as level 0 DFD is partitioned to reveal more

details.

Each of bubble may be refined or layered to depict more detail. We refine

the fundamental model into transform. This should be kept in mind that

information flow continuity must be maintained, that is, input and output to each

refinement must remain the same. This concept is really called balancing and is

essential for development of consistent model. The proposed system has four data

flow diagrams. They are explained below:

11

Page 12: MCA Project Report on JAVA Studio

Employee Transfer Management System

DFD FOR GENERAL EMPLOYEE TRANSFER

MANAGEMENT SYSTEM

ZEROTH LEVEL DFD

12

Page 13: MCA Project Report on JAVA Studio

Employee Transfer Management System

DFD FOR PROCESS OF SYSTEM LOGIN

1ST LEVEL DFD

13

Page 14: MCA Project Report on JAVA Studio

Employee Transfer Management System

DFD FOR EMPLOYEE TRANSFER REQUEST

2ND LEVEL DFD

14

Page 15: MCA Project Report on JAVA Studio

Employee Transfer Management System

DFD FOR ACCEPT AND REJECT TRANSFER REQUEST BY ADMINISTRATOR

3RDLEVEL DFD

15

Page 16: MCA Project Report on JAVA Studio

Employee Transfer Management System

E-R DIAGRAM FOR EMPLOYEE TRANSFER MANAGEMENT SYSTEM

16

Page 17: MCA Project Report on JAVA Studio

Employee Transfer Management System

E-R DIAGRAM FOR DATABASE DESIGN

17

Page 18: MCA Project Report on JAVA Studio

Employee Transfer Management System

6. SYSTEM DESIGN

Introduction

Analysis collects a great deal of unstructured data through interviews,

questionnaires, on-site observations, and procedural manuals and like. It is required

to organize and convert the data through system flowcharts, data flow diagrams,

structured English, decision tables and the like which support future development

of the system.

The Data flow diagrams and various processing logic techniques show

how, where, and when data are used or changed in an information system, but

these techniques do not show the definition, structure and relationships within the

data.

It is a way to focus on functions rather than the physical implementation.

This is analogous to the architect’s blueprint as a starting point for system design.

The design is a solution, a “how to” approach, compared to analysis, a “what is”

orientation.

System design is a highly creative process. This system design process is

also referred as data modeling. The most common formatted used the E-R notation

explains the characteristics and structure of data independent of how the data may

be stored in computer memories.

The process of system design can be divided into three stages. They are:

Structure design (already discussed)

Database design

Interface design

18

Page 19: MCA Project Report on JAVA Studio

Employee Transfer Management System

As we know that system design is a solution to “How to approach to the

creation of new system”. It provides the understudying and procedural details

necessary for implementing the system. The steps involved during system design

were as follow: -

1. LOGICAL AND PHYSICAL DESIGN

The current physical system was thoroughly reviewed from point of view

how the data flows, what are its file contents, its volumes and frequency etc.

After this input, output specifications security & control specification were

prepared. It was also decided that how physical information will flow through the

system and a physical design walkthrough.

2. OUTPUT DESIGN

Program output is most important and direct source of information to the

user. Efficient intelligible output design improves the system’s relationship with

the user and help in decision making. A major form of output is a hardcopy from

printer. The format of outputs is designed in such a way that it is simple to read

and interpret In the present output we have clearly labeled title it contains date and

time and all the fields are clearly mentioned (labeled).

3. INPUT DESIGN

Input design is the process of converted user originated inputs to a

computer based format in accurate input data are the most cause of errors in data

processing. So, the input should be well design and error free. Input data is

collected and organized into groups of similar data once identified appropriate

input media is selected for processing.

19

Page 20: MCA Project Report on JAVA Studio

Employee Transfer Management System

4. SCREEN DESIGN

The screen design for inputting the inputs were also panned as the format of

inputs.

5. INTERFACE DESIGN

User interface design creates an effective communication medium between

a human and a computer. Following asset of interface design principles, design

identifies objects and action and then creates a screen layout that forms the basis

for a user interface prototype. Interface design of Employee Transfer Management

System is based on the following three principles.

Place the user in control

During the information gathering session for Employee Transfer

Management System (BrowseWire IT Solutions), BrowseWire IT Solutions was

asked about the attributes that he would like to have in the GUI interface.

This was done to simplify the usage of software.

Reduce the user memory load

During The design Process of Employee Transfer Management System all

the possibilities such as using mnemonics for Particular action, providing visual

cues etc. are worked out to make user comfortable working with our software and

to make him remember less information.

20

Page 21: MCA Project Report on JAVA Studio

Employee Transfer Management System

Make the interface consistent

All possible efforts are undertaken to maintain standard user interface.

Some of these are:

1. All visual information (likes form) is organized according to a standard

that is maintain throughout all screen displays.

2. Consistent navigation is defined and implemented.

Information is display to the user in an easily understandable way and

layout. Visual layout is based on a real world image. Entry filling process first

shows list that is for categorizing information and then information is saved

according to that categorization.

Different indications are provided to enable the user to know the context of

the work at hand.

Indications

Proper interaction is necessary for good interface design. As computer

industry grows it becoming more and more versatile. There are number of

interaction device present in the Market like keyboard, mouse, digital pen, voice

recognition commands etc. which can be used for giving input. Also interaction is

not only concerted with device interaction, it is also concerned with system

interaction mean how much comfortable user feels while interaction with system.

Design feature of interaction:

Since different use have different preference as someone like to work

thought mouse or someone thought keyboard therefore choice have been provided

21

Page 22: MCA Project Report on JAVA Studio

Employee Transfer Management System

to user for using for using mouse and keyboard. Software interact equally well

with both using the device.

Our System is designed for interruptible interaction mean when involved in

sequence of action the use can interrupt the sequence to do something else (without

loosing the work that had been done).

Login Screen

When a user starts the software, the first form he encounters is the login

form. In the login form the user has to choose store name then fill his Username

and password. The form is used to keep check in, so that unauthorized users are

granted access to the system.

22

Page 23: MCA Project Report on JAVA Studio

Employee Transfer Management System

8. DATABASE DESIGN

The database for the “Employee Transfer Management System”

would has 4 tables each table has a specific motive behind its creation.

These tables will be created so that there will least amount of redundancy

and data is retrieved easily and efficiently.

Table : AdminDetails

This table stores the information about a particular administrator. This table

has 8 field and represents different attributes of the system administrator.

The ‘AdminID’ serves as the primary key.

Fields Data type Discription Constraint

AdminID varchar(50) Adminstrator’s Identity No.

Primary Key

AdminName varchar(50) Admin.’s NamePassword varchar(50) Password for LoginRetype varchar(50) Retype PasswordAddress varchar(50) Address of the

AdminstratorCity varchar(50) City NamePhoneNo varchar(50) Contact No.Email varchar(50) Email Address

Table : EmployeeDetails

This table stores the information about a particular administrator. This table

has 8 field and represents different attributes of the system administrator.

The ‘EmployeeID’ serves as the primary key.

Fields Data type Discription Constraint

EmployeeID varchar(50) Employee’s Identity No. Primary KeyEmployeeName varchar(50) Employee NamePassword varchar(50) Password for LoginRetype varchar(50) Retype PasswordAddress varchar(50) Address of the

AdminstratorCity varchar(50) City NamePhoneNo varchar(50) Contact No.Email varchar(50) Email Address

23

Page 24: MCA Project Report on JAVA Studio

Employee Transfer Management System

Table : EmployeeTransferDetails

This table stores the information about a particular administrator. This table

has 10 field and represents different attributes of the system administrator.

The ‘EmployeeID’ serves as the foreign key.

Fields Data type Discription Constraint

EmployeeID varchar(50) Employee’s Identity No. Foreign KeyEmployeeName varchar(50) Employee NameRole varchar(50) Current OccupationCurrentDepartment varchar(50) Department in which

workingTransferDepartment varchar(50) Deparment to which

transferTransferRelivingDate

varchar(50) Date of reliving from current location and deparment

TransferJoiningDate varchar(50) Date of joing where transferred

TransferLocation varchar(50) Name of place where transfer

CurrentLocation varchar(50) Name of place where currently working

WorkExperience varchar(50) Work Experience

Table : EmployeeTransferRequest

This table stores the information about a particular administrator. This table

has 9 field and represents different attributes of the system administrator.

The ‘EmployeeID’ serves as the foreign key.

Fields Data type Discription Constraint

EmployeeID varchar(50) Employee’s Identity No. Foreign KeyEmployeeName varchar(50) Employee NameRole varchar(50) Current OccupationWorkExperience varchar(50) Work ExperienceDepartment varchar(50) Current Department NameCurrentProject varchar(50) Current Project in HandCurrentLocation varchar(50) Name of place where

currently workingTransferProject varchar(50) Project in which

TransferredTransferLocation varchar(50) Name of place where

transfer

24

Page 25: MCA Project Report on JAVA Studio

Employee Transfer Management System

9. SCREENSHOTS AND SOURCE CODE

MAIN PAGE

Source Code MainPage.java

/* * MainPage.java*/

package Employee;import javax.swing.JOptionPane;import javax.swing.JDialog;import java.util.*;

public class MainPage extends javax.swing.JFrame { Date date; JOptionPane obj;

public MainPage() { date=new Date(); 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents

25

Page 26: MCA Project Report on JAVA Studio

Employee Transfer Management System

private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jbtnAdministrator = new javax.swing.JButton(); jbtnEmployee = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jbtnExitProject = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); lblTime = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jLabel1.setFont(new java.awt.Font("Bauhaus 93", 1, 48)); jLabel1.setForeground(new java.awt.Color(51, 102, 0)); jLabel1.setText("Employee Transfer Management");

jLabel3.setFont(new java.awt.Font("Bookman Old Style", 1, 24)); jLabel3.setForeground(new java.awt.Color(153, 0, 51)); jLabel3.setText(" Welcome In");

jLabel4.setFont(new java.awt.Font("Bookman Old Style", 1, 24)); jLabel4.setForeground(new java.awt.Color(153, 0, 51)); jLabel4.setText(" Employee Transfer Management");

jLabel5.setFont(new java.awt.Font("Arial", 1, 18)); jLabel5.setForeground(new java.awt.Color(0, 0, 102)); jLabel5.setText(" Select Any Option given in This Transfer Mangemet"); jLabel5.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0)));

jPanel1.setBackground(new java.awt.Color(255, 0, 0)); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 996, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 25, Short.MAX_VALUE) );

jbtnAdministrator.setFont(new java.awt.Font("Arial Black", 0, 18)); jbtnAdministrator.setText("Administrator");

26

Page 27: MCA Project Report on JAVA Studio

Employee Transfer Management System

jbtnAdministrator.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnAdministratorActionPerformed(evt); } });

jbtnEmployee.setFont(new java.awt.Font("Arial Black", 0, 18)); jbtnEmployee.setText("Employee"); jbtnEmployee.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnEmployeeActionPerformed(evt); } });

jPanel2.setBackground(new java.awt.Color(255, 0, 0)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 996, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 26, Short.MAX_VALUE) );

jLabel7.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\Eagle Creek.jpg")); jLabel7.setText("jLabel7");

jLabel8.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\VALENTINE'S7.gif")); jLabel8.setText("jLabel8");

jbtnExitProject.setFont(new java.awt.Font("Arial Black", 0, 18)); jbtnExitProject.setText("Exit Project"); jbtnExitProject.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnExitProjectActionPerformed(evt); } });

jPanel3.setBackground(new java.awt.Color(255, 255, 255)); jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0))); jLabel2.setFont(new java.awt.Font("Baskerville Old Face", 1, 36)); jLabel2.setText("Main Page");

org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(57, 57, 57)

27

Page 28: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(44, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE) );

lblTime.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18));

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel18.setText("jLabel17");

jLabel19.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel19.setText("jLabel17");

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(23, 23, 23) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 248, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(141, 141, 141) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 209, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(19, 19, 19) .add(jLabel4)) .add(layout.createSequentialGroup() .add(61, 61, 61) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(79, 79, 79) .add(lblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 307, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 258, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(31, 31, 31)) .add(layout.createSequentialGroup() .add(53, 53, 53) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(122, 122, 122)

28

Page 29: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jbtnAdministrator) .add(47, 47, 47) .add(jbtnEmployee, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 133, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(43, 43, 43) .add(jbtnExitProject, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 167, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 96, Short.MAX_VALUE) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(96, 96, 96) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 793, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(107, Short.MAX_VALUE)) .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap(80, Short.MAX_VALUE) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 839, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(77, 77, 77)) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(layout.createSequentialGroup() .add(87, 87, 87) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 254, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(42, 42, 42)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(jLabel1) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 29, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(131, 131, 131) .add(jLabel4) .add(28, 28, 28) .add(lblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(22, 22, 22)) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 256, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

29

Page 30: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(49, 49, 49) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(30, 30, 30) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jbtnEmployee, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 41, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jbtnAdministrator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jbtnExitProject, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(18, 18, 18) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>//GEN-END:initComponents

private void jbtnEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnEmployeeActionPerformed this.obj.showMessageDialog(this,"Login Only for Employee","Admin only",obj.DEFAULT_OPTION); Employee_Login obj1=new Employee_Login(); obj1.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jbtnEmployeeActionPerformed

private void jbtnExitProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnExitProjectActionPerformed this.obj.showMessageDialog(this,"Thank You for Using This Project","Information",obj.DEFAULT_OPTION); System.exit(0); }//GEN-LAST:event_jbtnExitProjectActionPerformed

private void jbtnAdministratorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnAdministratorActionPerformed this.obj.showMessageDialog(this,"Login Only for Admin","Admin only",obj.DEFAULT_OPTION); AdminLogin obj1=new AdminLogin(); obj1.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jbtnAdministratorActionPerformed

private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened this.lblTime.setText(this.date.toString());

30

Page 31: MCA Project Report on JAVA Studio

Employee Transfer Management System

}//GEN-LAST:event_formWindowOpened

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

// Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JButton jbtnAdministrator; private javax.swing.JButton jbtnEmployee; private javax.swing.JButton jbtnExitProject; private javax.swing.JLabel lblTime; // End of variables declaration//GEN-END:variables

}

31

Page 32: MCA Project Report on JAVA Studio

Employee Transfer Management System

ADMINISTRATOR LOGIN PAGE

Source Code AdminLogin.java

/* * AdminLogin.java * * Created on August 25, 2009, 11:24 AM */

package Employee;

import java.sql.*;import javax.swing.JOptionPane;import javax.swing.JDialog;import java.util.Date;

/** * * @author user */public class AdminLogin extends javax.swing.JFrame {

Date date; JOptionPane pane; Statement stmt; Connection con;

32

Page 33: MCA Project Report on JAVA Studio

Employee Transfer Management System

ResultSet rs;

public AdminLogin() { date=new Date(); Connection(); initComponents(); } void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jtxtPassword = new javax.swing.JPasswordField(); jtxtUserName = new javax.swing.JTextField(); jbtnLogOut = new javax.swing.JButton(); jbtnLogin = new javax.swing.JButton(); jbtnCancel = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); jbtnClickHere = new javax.swing.JButton(); lblTime = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() {

33

Page 34: MCA Project Report on JAVA Studio

Employee Transfer Management System

public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jLabel1.setFont(new java.awt.Font("Algerian", 1, 24)); jLabel1.setForeground(new java.awt.Color(0, 102, 0)); jLabel1.setText("Employee Transfer Management");

jLabel2.setFont(new java.awt.Font("Bernard MT Condensed", 1, 24)); jLabel2.setForeground(new java.awt.Color(153, 0, 0)); jLabel2.setText(" Admin Login Page");

jPanel1.setBackground(new java.awt.Color(204, 255, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0))); jLabel3.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); jLabel3.setForeground(new java.awt.Color(0, 102, 102)); jLabel3.setText(" Login Page");

jLabel4.setFont(new java.awt.Font("Calisto MT", 1, 18)); jLabel4.setText("User Name");

jLabel5.setFont(new java.awt.Font("Calisto MT", 1, 18)); jLabel5.setText("password");

jbtnLogOut.setFont(new java.awt.Font("Arial Narrow", 1, 14)); jbtnLogOut.setText("Log Out"); jbtnLogOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnLogOutActionPerformed(evt); } });

jbtnLogin.setFont(new java.awt.Font("Arial Black", 0, 14)); jbtnLogin.setText("Login"); jbtnLogin.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnLoginActionPerformed(evt); } });

jbtnCancel.setFont(new java.awt.Font("Arial Black", 0, 14)); jbtnCancel.setText("Cancel"); jbtnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnCancelActionPerformed(evt); } });

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(116, 116, 116)

34

Page 35: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jbtnLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel1Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 128, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(47, 47, 47) .add(jbtnCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel1Layout.createSequentialGroup() .add(71, 71, 71) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jtxtUserName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) .add(jPanel1Layout.createSequentialGroup() .addContainerGap() .add(jbtnLogOut, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(121, 121, 121) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(69, 69, 69)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .addContainerGap(24, Short.MAX_VALUE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(47, 47, 47) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel1Layout.createSequentialGroup() .add(34, 34, 34) .add(jtxtUserName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(34, 34, 34) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))

35

Page 36: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(44, 44, 44) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jbtnLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jbtnCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(25, 25, 25)) .add(jPanel1Layout.createSequentialGroup() .addContainerGap() .add(jbtnLogOut) .addContainerGap(254, Short.MAX_VALUE)) );

jLabel8.setFont(new java.awt.Font("Arial Unicode MS", 1, 18)); jLabel8.setForeground(new java.awt.Color(51, 51, 255)); jLabel8.setText(" To Create New Admin Login"); jLabel8.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(255, 0, 0)));

jbtnClickHere.setFont(new java.awt.Font("Arial Black", 1, 12)); jbtnClickHere.setText("Click Here"); jbtnClickHere.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnClickHereActionPerformed(evt); } });

jLabel6.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel6.setText("jLabel2");

jLabel7.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel7.setText("jLabel2");

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(61, 61, 61) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 272, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jbtnClickHere, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19) .add(lblTime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .addContainerGap()) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(12, 12, 12) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

36

Page 37: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createSequentialGroup() .add(29, 29, 29) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 443, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(118, 118, 118) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 276, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 28, Short.MAX_VALUE) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(37, 37, 37)) .add(layout.createSequentialGroup() .add(89, 89, 89) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(76, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .add(jLabel1) .add(57, 57, 57) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(29, 29, 29) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(35, 35, 35) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jbtnClickHere) .add(lblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jLabel8))) ); pack(); }// </editor-fold>//GEN-END:initComponents

private void jbtnLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnLoginActionPerformed String password=String.valueOf(this.jtxtPassword.getPassword()); try { String str="select AdminID from AdminDetails where AdminID='"+this.jtxtUserName.getText()+"'and password='"+password+"'"; rs=this.stmt.executeQuery(str); if(rs.next()) {

37

Page 38: MCA Project Report on JAVA Studio

Employee Transfer Management System

pane.showMessageDialog(this,"Wel Come Mr "+this.jtxtUserName.getText()+" in Admin Page","Information",pane.INFORMATION_MESSAGE); AdminPages objAdmin=new AdminPages(this.jtxtUserName.getText()); objAdmin.setVisible(true); this.setVisible(false); } else { pane.showMessageDialog(this,"Admin ID and Password Not Matched","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"ERROR",pane.ERROR_MESSAGE); }

}//GEN-LAST:event_jbtnLoginActionPerformed

private void jbtnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCancelActionPerformed this.jtxtUserName.setText(" "); this.jtxtPassword.setText(" "); }//GEN-LAST:event_jbtnCancelActionPerformed

private void jbtnLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnLogOutActionPerformed MainPage obj1=new MainPage(); obj1.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jbtnLogOutActionPerformed

private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened this.lblTime.setText(this.date.toString()); }//GEN-LAST:event_formWindowOpened

private void jbtnClickHereActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnClickHereActionPerformed pane.showMessageDialog(this,"Create New Admin Accout","New Account",pane.INFORMATION_MESSAGE); NewAdminPage obj1=new NewAdminPage(); obj1.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jbtnClickHereActionPerformed

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

38

Page 39: MCA Project Report on JAVA Studio

Employee Transfer Management System

// Variables declaration - do not modify//GEN-BEGIN:variables 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.JPanel jPanel1; private javax.swing.JButton jbtnCancel; private javax.swing.JButton jbtnClickHere; private javax.swing.JButton jbtnLogOut; private javax.swing.JButton jbtnLogin; private javax.swing.JPasswordField jtxtPassword; private javax.swing.JTextField jtxtUserName; private javax.swing.JLabel lblTime; // End of variables declaration//GEN-END:variables

}

39

Page 40: MCA Project Report on JAVA Studio

Employee Transfer Management System

NEW ADMIN FORM

Source Code NewAdminPage.java

/* * NewAdminPage.java * * Created on August 26, 2009, 9:17 AM */

package Employee;

import java.sql.*;import java.util.Date;import javax.swing.*;

/** * * @author user */public class NewAdminPage extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date; public NewAdminPage() { date=new Date(); Connection(); initComponents();

40

Page 41: MCA Project Report on JAVA Studio

Employee Transfer Management System

} void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jtxtAdminName = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jtxtAdminID = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jtxtAddress = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jtxtCity = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); jtxtPhoneNo = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jtxtEmail = new javax.swing.JTextField();

41

Page 42: MCA Project Report on JAVA Studio

Employee Transfer Management System

jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jtxtPassword = new javax.swing.JPasswordField(); jtxtRetype = new javax.swing.JPasswordField(); jPanel5 = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jlblTime = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowIconified(java.awt.event.WindowEvent evt) { formWindowIconified(evt); } public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jPanel1.setBackground(new java.awt.Color(51, 51, 0)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 51))); jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 36)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText(" Employee Transfer Management ");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 663, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE) );

jLabel2.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel2.setText("jLabel2");

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 24)); jLabel4.setForeground(new java.awt.Color(153, 0, 0));

42

Page 43: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel4.setText(" New Admin Details");

jPanel2.setBackground(new java.awt.Color(0, 51, 204)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 999, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 13, Short.MAX_VALUE) );

jPanel3.setBackground(new java.awt.Color(0, 51, 204)); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 999, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 13, Short.MAX_VALUE) );

jPanel4.setBackground(new java.awt.Color(255, 255, 204)); jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 51))); jLabel5.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel5.setText("Admin Name");

jLabel6.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 12)); jLabel6.setForeground(new java.awt.Color(204, 0, 51)); jLabel6.setText("Admin ID Must be Unique");

jLabel7.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel7.setText("Admin ID");

jLabel8.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel8.setText("Admin Password");

jLabel9.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 12)); jLabel9.setForeground(new java.awt.Color(204, 0, 51)); jLabel9.setText("Admin Password Must be Unique");

jLabel10.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel10.setText("Retype Password");

jLabel11.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel11.setText("Address");

jLabel12.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel12.setText("City");

jLabel13.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel13.setText("Phone No");

43

Page 44: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel14.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel14.setText("Email");

jButton1.setFont(new java.awt.Font("Arial", 1, 14)); jButton1.setText("Add Details"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });

jButton2.setFont(new java.awt.Font("Arial", 1, 14)); jButton2.setText("Referesh"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });

jButton3.setFont(new java.awt.Font("Arial", 1, 14)); jButton3.setText("Exit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });

jtxtRetype.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jtxtRetypeFocusLost(evt); } });

org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel4Layout.createSequentialGroup() .add(jLabel5) .add(29, 29, 29) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup() .add(jLabel10) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jtxtRetype, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(jPanel4Layout.createSequentialGroup()

44

Page 45: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7) .add(jLabel8)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 7, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtAdminID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) .add(jPanel4Layout.createSequentialGroup() .add(75, 75, 75) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 177, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(59, 59, 59) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 224, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 51, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel13, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel12, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel11, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtCity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtPhoneNo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtEmail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createSequentialGroup() .add(14, 14, 14) .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 7, Short.MAX_VALUE)

45

Page 46: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(42, 42, 42)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel5) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel11)) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel4Layout.createSequentialGroup() .add(16, 16, 16) .add(jLabel6) .add(18, 18, 18) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jtxtAdminID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel7)) .add(46, 46, 46) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(19, 19, 19) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel9) .add(jLabel14))) .add(jPanel4Layout.createSequentialGroup() .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtCity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel12)) .add(34, 34, 34) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtPhoneNo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel13)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jtxtEmail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)

46

Page 47: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel10) .add(jtxtRetype, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(22, Short.MAX_VALUE)) .add(jPanel4Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jButton1) .add(jButton2) .add(jButton3)) .addContainerGap()))) );

jPanel5.setBackground(new java.awt.Color(0, 0, 0)); jLabel15.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jLabel15.setForeground(new java.awt.Color(255, 255, 255)); jLabel15.setText(" Add Admin New Details Here");

org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(47, 47, 47) .add(jLabel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 399, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(56, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel15) .addContainerGap()) );

jButton4.setFont(new java.awt.Font("Arial", 1, 14)); jButton4.setText("Log Out"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel16.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\apenquin.gif")); jLabel16.setText("jLabel16");

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel17.setText("jLabel17");

47

Page 48: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel18.setText("jLabel17");

jLabel19.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel19.setText("jLabel17");

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(24, 24, 24) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(154, 154, 154) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 287, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(22, 22, 22) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 257, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(20, 20, 20) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(47, Short.MAX_VALUE)) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(32, 32, 32) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(75, 75, 75) .add(jButton4) .add(60, 60, 60) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

48

Page 49: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createSequentialGroup() .add(16, 16, 16) .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(34, 34, 34) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(38, 38, 38) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(29, 29, 29) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel4) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(18, 18, 18) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(28, 28, 28) .add(jButton4))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 13, Short.MAX_VALUE) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18))

49

Page 50: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createSequentialGroup() .add(46, 46, 46) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(59, 59, 59) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(73, 73, 73)))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(24, 24, 24) .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 208, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(66, 66, 66))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>//GEN-END:initComponents

private void formWindowIconified(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowIconified// TODO add your handling code here: }//GEN-LAST:event_formWindowIconified

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed pane.showMessageDialog(this,"Thank You for Using this project","Conformation",pane.INFORMATION_MESSAGE); System.exit(0); }//GEN-LAST:event_jButton3ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed String Password=String.valueOf(this.jtxtPassword.getPassword()); String Retype=String.valueOf(this.jtxtRetype.getPassword()); try { String str="insert into AdminDetails values('"+this.jtxtAdminName.getText()+"','"+this.jtxtAdminID.getText()+"','"+Password+"','"+Retype+"','"+this.jtxtAddress.getText()+"','"+this.jtxtCity.getText()+"','"+this.jtxtPhoneNo.getText()+"','"+this.jtxtEmail.getText()+"')"; this.stmt.executeUpdate(str); pane.showMessageDialog(this,"Record are Successfully Added","Conformation",pane.INFORMATION_MESSAGE); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }//GEN-LAST:event_jButton1ActionPerformed

private void jtxtRetypeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jtxtRetypeFocusLost String Password=String.valueOf(this.jtxtPassword.getPassword()); String Retype=String.valueOf(this.jtxtRetype.getPassword());

50

Page 51: MCA Project Report on JAVA Studio

Employee Transfer Management System

if(Retype.equals(Password)) { Retype=" "; } else { pane.showMessageDialog(this,"Password Does Not Matched","Error",pane.ERROR_MESSAGE); } }//GEN-LAST:event_jtxtRetypeFocusLost

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed this.jtxtAddress.setText(" "); this.jtxtAdminID.setText(" "); this.jtxtAdminName.setText(" "); this.jtxtCity.setText(" "); this.jtxtPassword.setText(" "); this.jtxtPhoneNo.setText(" "); this.jtxtRetype.setText(" "); this.jtxtEmail.setText(" ");

}//GEN-LAST:event_jButton2ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed AdminLogin obj1=new AdminLogin(); obj1.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jButton4ActionPerformed private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened this.jlblTime.setText(this.date.toString()); }//GEN-LAST:event_formWindowOpened

/** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewAdminPage().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables 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 jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18;

51

Page 52: MCA Project Report on JAVA Studio

Employee Transfer Management System

private javax.swing.JLabel jLabel19; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JLabel jlblTime; private javax.swing.JTextField jtxtAddress; private javax.swing.JTextField jtxtAdminID; private javax.swing.JTextField jtxtAdminName; private javax.swing.JTextField jtxtCity; private javax.swing.JTextField jtxtEmail; private javax.swing.JPasswordField jtxtPassword; private javax.swing.JTextField jtxtPhoneNo; private javax.swing.JPasswordField jtxtRetype; // End of variables declaration//GEN-END:variables

}

52

Page 53: MCA Project Report on JAVA Studio

Employee Transfer Management System

ADMIN PAGE

Source Code AdminPage.java

* AdminPages.java * * Created on August 26, 2009, 12:14 PM */package Employee;import java.sql.*;import java.util.Date;import javax.swing.*;

/** * * @author user */public class AdminPages extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date; String Name; public AdminPages(String n) { Name=n; date=new Date(); Connection(); initComponents(); } void Connection() {

53

Page 54: MCA Project Report on JAVA Studio

Employee Transfer Management System

try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

} /** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jlblName = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jLabel19 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jButton5 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } public void windowOpened(java.awt.event.WindowEvent evt) {

54

Page 55: MCA Project Report on JAVA Studio

Employee Transfer Management System

formWindowOpened(evt); } });

jLabel1.setFont(new java.awt.Font("Bauhaus 93", 1, 48)); jLabel1.setForeground(new java.awt.Color(51, 102, 0)); jLabel1.setText(" Employee Transfer Management");

jLabel5.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\basics_welcome.jpg")); jLabel5.setText("jLabel5");

jLabel6.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\basics_welcome.jpg")); jLabel6.setText("jLabel5");

jLabel2.setFont(new java.awt.Font("Algerian", 1, 36)); jLabel2.setForeground(new java.awt.Color(0, 51, 204)); jLabel2.setText("Admin Page");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel8.setFont(new java.awt.Font("Bauhaus 93", 1, 36)); jLabel8.setForeground(new java.awt.Color(102, 102, 0)); jLabel8.setText("WelCome Mr");

jlblName.setFont(new java.awt.Font("Bauhaus 93", 1, 36)); jlblName.setForeground(new java.awt.Color(204, 0, 0));

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel4.setText("jLabel2");

jLabel7.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\logo.gif")); jLabel7.setText("jLabel7");

jPanel1.setBackground(new java.awt.Color(204, 0, 204)); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1070, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 18, Short.MAX_VALUE) );

55

Page 56: MCA Project Report on JAVA Studio

Employee Transfer Management System

jPanel3.setBackground(new java.awt.Color(102, 102, 0)); jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 0))); jLabel10.setFont(new java.awt.Font("Arial Black", 0, 18)); jLabel10.setForeground(new java.awt.Color(255, 255, 255)); jLabel10.setText(" Select Any Option Given In this Management");

org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(38, 38, 38) .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 518, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(38, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE) );

jLabel9.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel9.setText("jLabel9");

jLabel11.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel11.setText("jLabel9");

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel18.setText("jLabel17");

jButton1.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton1.setText("New Transfer"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });

jButton2.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton2.setText("Update Transfer"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });

jButton4.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton4.setText("Exit Project"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {

56

Page 57: MCA Project Report on JAVA Studio

Employee Transfer Management System

jButton4ActionPerformed(evt); } });

jLabel19.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel19.setText("jLabel17");

jPanel2.setBackground(new java.awt.Color(204, 0, 204)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1070, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 18, Short.MAX_VALUE) );

jButton5.setFont(new java.awt.Font("Arial", 1, 14)); jButton5.setText("Log Out"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } });

jButton7.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton7.setText("Searching Transfer"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } });

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 158, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(55, 55, 55) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 142, Short.MAX_VALUE)

57

Page 58: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 253, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(47, 47, 47)) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 336, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(49, 49, 49)) .add(layout.createSequentialGroup() .add(89, 89, 89) .add(jLabel8) .add(24, 24, 24) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 241, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(77, 77, 77))) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 158, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 828, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(57, 57, 57)))) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(105, 105, 105) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(37, 37, 37) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(layout.createSequentialGroup() .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(35, 35, 35) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(jButton1) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jButton7) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jButton2) .add(21, 21, 21) .add(jButton4) .add(50, 50, 50))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup()

58

Page 59: MCA Project Report on JAVA Studio

Employee Transfer Management System

.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 22, Short.MAX_VALUE) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(21, 21, 21)) .add(layout.createSequentialGroup() .add(30, 30, 30) .add(jButton5) .addContainerGap()))) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(109, 109, 109) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 773, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(188, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(23, 23, 23) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 167, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(15, 15, 15) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel2) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 167, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(15, 15, 15) .add(jLabel7) .add(19, 19, 19) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

59

Page 60: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(14, 14, 14) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton5)) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Search Employee Transfer Record Here","Information",pane.DEFAULT_OPTION); EmployeeTransferSearch obj1=new EmployeeTransferSearch(this.jlblName.getText()); obj1.setVisible(true); this.setVisible(false); }

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Add Your New Employee Transfer Here","Information",pane.DEFAULT_OPTION); UpdateEmployeeTransfer obj1=new UpdateEmployeeTransfer(this.jlblName.getText()); obj1.setVisible(true); this.setVisible(false); }

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Add Your New Employee Transfer Here","Information",pane.DEFAULT_OPTION); NewEmployeeTransfer obj1=new NewEmployeeTransfer(this.jlblName.getText()); obj1.setVisible(true); this.setVisible(false); }

60

Page 61: MCA Project Report on JAVA Studio

Employee Transfer Management System

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Thank You for Using This Project","Information",pane.DEFAULT_OPTION); System.exit(0); }

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { AdminLogin obj1=new AdminLogin(); obj1.setVisible(true); this.setVisible(false); }

private void formWindowActivated(java.awt.event.WindowEvent evt) { // TODO add your handling code here: }

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); this.jlblName.setText(Name.toString()); }

/** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { // new AdminPages().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JLabel jlblName; private javax.swing.JLabel jlblTime; // End of variables declaration

}

61

Page 62: MCA Project Report on JAVA Studio

Employee Transfer Management System

UPDATEEMPLOYEETRANSFER

Source Code UpdateEmployeeTransfer.java

/* * UpdateEmployeeTransfer.java * * Created on August 29, 2009, 9:32 AM */

package Employee;import java.sql.*;import java.util.Date;import javax.swing.*;/** * * @author user */public class UpdateEmployeeTransfer extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date; String name; public UpdateEmployeeTransfer(String n) { name=n; date=new Date();

62

Page 63: MCA Project Report on JAVA Studio

Employee Transfer Management System

Connection(); initComponents(); } void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jcboDate = new javax.swing.JComboBox(); jLabel5 = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); jtxtCurrentDepartment = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jtxtJoiningDate = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); jtxtTransferLocation = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jtxtCurrentLocation = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); jtxtWorkExperience = new javax.swing.JTextField();

63

Page 64: MCA Project Report on JAVA Studio

Employee Transfer Management System

jtxtTransferDepartment = new javax.swing.JTextField(); jLabel20 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jlstID = new java.awt.List(); jlstName = new java.awt.List(); jLabel10 = new javax.swing.JLabel(); jlstEmployeeRole = new java.awt.List(); jbtnUpdate = new javax.swing.JButton(); jbtnReferesh = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jLabel16 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); jlblName = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jPanel1.setBackground(new java.awt.Color(51, 51, 0)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 51))); jLabel2.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 36)); jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText(" Employee Transfer Management ");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 663, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE) );

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel4.setText("jLabel2");

jLabel6.setFont(new java.awt.Font("Arial Black", 1, 24)); jLabel6.setForeground(new java.awt.Color(204, 0, 0));

64

Page 65: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel6.setText(" Update Employee transfer Details");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel17.setText("jLabel16");

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel18.setText("jLabel16");

jPanel2.setBackground(new java.awt.Color(255, 0, 204)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 975, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 20, Short.MAX_VALUE) );

jPanel5.setBackground(new java.awt.Color(255, 255, 255)); jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 51, 0))); jLabel9.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel9.setText("Transfer Revling Date:-");

jcboDate.setBackground(new java.awt.Color(204, 255, 204)); jcboDate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboDateActionPerformed(evt); } });

jLabel5.setFont(new java.awt.Font("Arial Unicode MS", 1, 14)); jLabel5.setForeground(new java.awt.Color(255, 0, 0)); jLabel5.setText("Search Transfer Revling Date For UpdateTransfer");

org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .addContainerGap() .add(jLabel9) .add(24, 24, 24) .add(jcboDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 193, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel5Layout.createSequentialGroup() .add(29, 29, 29)

65

Page 66: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel5))) .addContainerGap(20, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap() .add(jLabel5) .add(16, 16, 16) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel9) .add(jcboDate, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE)) .addContainerGap()) );

jPanel3.setBackground(new java.awt.Color(204, 255, 204)); jPanel3.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(51, 0, 255))); jLabel11.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel11.setText("Current Department");

jLabel12.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel12.setText("Transfer Joining Date");

jLabel13.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel13.setText("Transfer Location");

jLabel14.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel14.setText("Current Location");

jLabel15.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel15.setText("Work Experience");

jLabel20.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel20.setText("Transfer Department");

org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(29, 29, 29) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel14) .add(jLabel15) .add(jLabel11) .add(jLabel13) .add(jLabel12) .add(jLabel20)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 21, Short.MAX_VALUE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jtxtTransferLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtWorkExperience, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtCurrentLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

66

Page 67: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jtxtCurrentDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtJoiningDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtTransferDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(40, 40, 40)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(21, 21, 21) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel11) .add(jtxtCurrentDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(26, 26, 26) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel20) .add(jtxtTransferDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(37, 37, 37) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtJoiningDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(32, 32, 32) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel13) .add(jtxtTransferLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(19, 19, 19) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jtxtCurrentLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel14)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 35, Short.MAX_VALUE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtWorkExperience, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel15)) .add(32, 32, 32)) );

jPanel4.setBackground(new java.awt.Color(204, 255, 255)); jPanel4.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(51, 0, 255))); jLabel7.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel7.setText("Employee ID");

jLabel8.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel8.setText("Employee Name");

jlstID.setEnabled(false);

jlstName.setEnabled(false);

jLabel10.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

67

Page 68: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel10.setText("Employee Role");

jlstEmployeeRole.setEnabled(false);

org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(18, 18, 18) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jLabel10) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 40, Short.MAX_VALUE) .add(jlstEmployeeRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 183, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jLabel8) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 29, Short.MAX_VALUE) .add(jlstName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 183, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(47, 47, 47) .add(jlstID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 183, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(44, Short.MAX_VALUE)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(39, 39, 39) .add(jLabel7)) .add(jPanel4Layout.createSequentialGroup() .add(19, 19, 19) .add(jlstID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 56, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(39, 39, 39) .add(jlstName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 60, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(54, 54, 54) .add(jLabel8))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jLabel10) .add(53, 53, 53))

68

Page 69: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jlstEmployeeRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 60, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(25, 25, 25)))) );

jbtnUpdate.setFont(new java.awt.Font("Arial Black", 1, 14)); jbtnUpdate.setText("Update"); jbtnUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnUpdateActionPerformed(evt); } });

jbtnReferesh.setFont(new java.awt.Font("Arial Black", 1, 14)); jbtnReferesh.setText("Refresh"); jbtnReferesh.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnRefereshActionPerformed(evt); } });

jButton3.setFont(new java.awt.Font("Arial Black", 1, 14)); jButton3.setText("Exit "); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });

jButton4.setFont(new java.awt.Font("Arial", 1, 14)); jButton4.setText("Back"); jButton4.setMaximumSize(new java.awt.Dimension(73, 29)); jButton4.setMinimumSize(new java.awt.Dimension(73, 29)); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

jLabel16.setFont(new java.awt.Font("Arial Black", 1, 14)); jLabel16.setForeground(new java.awt.Color(0, 0, 204)); jLabel16.setText("Search Transfer Revling Date For UpdateTransfer");

jLabel19.setFont(new java.awt.Font("Bodoni MT Black", 0, 24)); jLabel19.setForeground(new java.awt.Color(0, 0, 204)); jLabel19.setText("Wel come Mr ");

jlblName.setFont(new java.awt.Font("Bodoni MT Black", 0, 24)); jlblName.setForeground(new java.awt.Color(0, 102, 51));

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(19, 19, 19)

69

Page 70: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(39, 39, 39) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 129, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(32, 32, 32)))) .add(layout.createSequentialGroup() .add(126, 126, 126) .add(jLabel6))) .add(25, 25, 25) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(39, Short.MAX_VALUE)) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(93, 93, 93) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 290, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(28, 28, 28) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(18, 18, 18) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(51, 51, 51) .add(jbtnUpdate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 97, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(15, 15, 15) .add(jbtnReferesh) .add(18, 18, 18) .add(jButton3) .add(23, 23, 23)

70

Page 71: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(27, 27, 27) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(40, 40, 40) .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 462, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(18, 18, 18)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(16, 16, 16) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel18) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel17) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(43, 43, 43) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 105, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel16) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jbtnUpdate) .add(jbtnReferesh)

71

Page 72: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jButton3) .add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(14, 14, 14) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(15, 15, 15) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); pack(); }// </editor-fold>

private void jbtnUpdateActionPerformed(java.awt.event.ActionEvent evt) { try { String str="update EmployeeTransferDetails set CurrentDepartment='"+this.jtxtCurrentDepartment.getText()+"',TransferDepartment='"+this.jtxtTransferDepartment.getText()+"',TransferJoiningDate='"+this.jtxtJoiningDate.getText()+"',TransferLocation='"+this.jtxtTransferLocation.getText()+"',CurrentLocation='"+this.jtxtCurrentLocation.getText()+"',WorkExperience='"+this.jtxtWorkExperience.getText()+"'"; this.stmt.executeUpdate(str); pane.showMessageDialog(this,"Record are Updated","Conformation",pane.INFORMATION_MESSAGE); }catch(SQLException es) { pane.showMessageDialog(this,"SQL ERROR"+es.toString(),"ERROR",pane.ERROR_MESSAGE); } }

private void jbtnRefereshActionPerformed(java.awt.event.ActionEvent evt) { this.jtxtCurrentDepartment.setText(" "); this.jtxtCurrentLocation.setText(" "); this.jtxtJoiningDate.setText(" "); this.jtxtTransferDepartment.setText(" "); this.jtxtTransferLocation.setText(" "); this.jtxtWorkExperience.setText(" "); }

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { pane.showMessageDialog(this,"Thank You for Using this project","Conformation",pane.INFORMATION_MESSAGE); System.exit(0); }

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); this.jlblName.setText(name.toString());

72

Page 73: MCA Project Report on JAVA Studio

Employee Transfer Management System

try { String str="select TransferRelivingDate from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do { this.jcboDate.insertItemAt(rs.getString(1),cnt); cnt++; }while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { AdminPages obj1=new AdminPages(this.jlblName.getText()); obj1.setVisible(true); this.setVisible(false); }

private void jcboDateActionPerformed(java.awt.event.ActionEvent evt) { try { String str="select EmployeeID,EmployeeName,Role,WorkExperience,CurrentDepartment,TransferDepartment,TransferJoiningDate,CurrentLocation,TransferLocation from EmployeeTransferDetails where TransferRelivingDate='"+this.jcboDate.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { this.jlstID.removeAll(); this.jlstEmployeeRole.removeAll(); this.jlstName.removeAll();

int cnt=0; do { this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt); this.jlstEmployeeRole.add(rs.getString(3),cnt); cnt++;

this.jtxtWorkExperience.setText(rs.getString(4)); this.jtxtCurrentDepartment.setText(rs.getString(5)); this.jtxtTransferDepartment.setText(rs.getString(6)); this.jtxtJoiningDate.setText(rs.getString(7)); this.jtxtCurrentLocation.setText(rs.getString(8)); this.jtxtTransferLocation.setText(rs.getString(9));

73

Page 74: MCA Project Report on JAVA Studio

Employee Transfer Management System

}while(rs.next()); this.jbtnUpdate.setEnabled(true); this.jbtnReferesh.setEnabled(true); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

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

// Variables declaration - do not modify private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; 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 jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JButton jbtnReferesh; private javax.swing.JButton jbtnUpdate; private javax.swing.JComboBox jcboDate; private javax.swing.JLabel jlblName; private javax.swing.JLabel jlblTime; private java.awt.List jlstEmployeeRole; private java.awt.List jlstID; private java.awt.List jlstName; private javax.swing.JTextField jtxtCurrentDepartment;

74

Page 75: MCA Project Report on JAVA Studio

Employee Transfer Management System

private javax.swing.JTextField jtxtCurrentLocation; private javax.swing.JTextField jtxtJoiningDate; private javax.swing.JTextField jtxtTransferDepartment; private javax.swing.JTextField jtxtTransferLocation; private javax.swing.JTextField jtxtWorkExperience; // End of variables declaration

}

75

Page 76: MCA Project Report on JAVA Studio

Employee Transfer Management System

EMPLOYEE LOGIN

Source Code Employee_Login.java

/* * Employee_Login.java * * Created on August 26, 2009, 1:14 PM */

package Employee;

import java.sql.*;import javax.swing.JOptionPane;import javax.swing.JDialog;import java.util.Date;/** * * @author user */public class Employee_Login extends javax.swing.JFrame {

Date date; JOptionPane pane; Statement stmt; Connection con;

76

Page 77: MCA Project Report on JAVA Studio

Employee Transfer Management System

ResultSet rs; public Employee_Login() { date=new Date(); Connection(); initComponents(); } void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jtxtPassword = new javax.swing.JPasswordField(); jtxtUserName = new javax.swing.JTextField(); jbtnLogin = new javax.swing.JButton(); jbtnCancel = new javax.swing.JButton(); jbtnLogOut = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); jbtnClickHere = new javax.swing.JButton(); lblTime = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel();

77

Page 78: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel14 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jLabel1.setFont(new java.awt.Font("Algerian", 1, 24)); jLabel1.setForeground(new java.awt.Color(0, 102, 0)); jLabel1.setText("Employee Transfer Management");

jLabel6.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel6.setText("jLabel2");

jLabel7.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel7.setText("jLabel2");

jLabel2.setFont(new java.awt.Font("Arial Black", 1, 24)); jLabel2.setForeground(new java.awt.Color(0, 0, 204)); jLabel2.setText("Employee Login Page");

jPanel1.setBackground(new java.awt.Color(255, 255, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0))); jLabel3.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); jLabel3.setForeground(new java.awt.Color(0, 102, 102)); jLabel3.setText(" Login Page");

jLabel4.setFont(new java.awt.Font("CalistoMT", 1, 18)); jLabel4.setText("User Name");

jLabel5.setFont(new java.awt.Font("CalistoMT", 1, 18)); jLabel5.setText("password");

jbtnLogin.setFont(new java.awt.Font("Arial Black", 0, 14)); jbtnLogin.setText("Login"); jbtnLogin.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnLoginActionPerformed(evt); } });

jbtnCancel.setFont(new java.awt.Font("Arial Black", 0, 14)); jbtnCancel.setText("Cancel"); jbtnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnCancelActionPerformed(evt); } });

jbtnLogOut.setFont(new java.awt.Font("Arial Narrow", 1, 14)); jbtnLogOut.setText("Log Out"); jbtnLogOut.addActionListener(new java.awt.event.ActionListener() {

78

Page 79: MCA Project Report on JAVA Studio

Employee Transfer Management System

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

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(116, 116, 116) .add(jbtnLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(47, 47, 47) .add(jbtnCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(149, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(76, Short.MAX_VALUE) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel1Layout.createSequentialGroup() .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 128, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(71, 71, 71) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtUserName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(68, 68, 68)) .add(jPanel1Layout.createSequentialGroup() .add(166, 166, 166) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 115, Short.MAX_VALUE) .add(jbtnLogOut, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(29, 29, 29)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(24, 24, 24) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel1Layout.createSequentialGroup() .addContainerGap() .add(jbtnLogOut))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jtxtUserName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

79

Page 80: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel1Layout.createSequentialGroup() .add(13, 13, 13) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(34, 34, 34) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(44, 44, 44) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jbtnLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jbtnCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(25, 25, 25)) );

jLabel8.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 14)); jLabel8.setForeground(new java.awt.Color(51, 51, 255)); jLabel8.setText(" To Create New Admin Login");

jbtnClickHere.setFont(new java.awt.Font("Arial Black", 1, 12)); jbtnClickHere.setText("Click Here"); jbtnClickHere.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnClickHereActionPerformed(evt); } });

jLabel10.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel10.setText("jLabel9");

jLabel11.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel11.setText("jLabel9");

jLabel12.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel12.setText("jLabel9");

jLabel13.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel13.setText("jLabel9");

jLabel9.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel9.setText("jLabel9");

jLabel14.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif"));

80

Page 81: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel14.setText("jLabel9");

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(18, 18, 18) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(26, 26, 26) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 443, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(66, 66, 66) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 311, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(20, 20, 20) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(28, 28, 28) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(24, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 241, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14)

81

Page 82: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jbtnClickHere, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 43, Short.MAX_VALUE) .add(lblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 265, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) .add(40, 40, 40)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(jLabel1) .add(28, 28, 28) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createSequentialGroup() .add(21, 21, 21) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(63, 63, 63) .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(32, 32, 32) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(38, 38, 38) .add(jLabel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(67, 67, 67)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 14, Short.MAX_VALUE) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(54, 54, 54)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(31, 31, 31) .add(jLabel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(50, 50, 50) .add(jLabel14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 53, Short.MAX_VALUE) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(66, 66, 66))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)

82

Page 83: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jbtnClickHere) .add(lblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) ); pack(); }// </editor-fold>

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.lblTime.setText(this.date.toString()); }

private void jbtnClickHereActionPerformed(java.awt.event.ActionEvent evt) { pane.showMessageDialog(this,"Create New Employee Account Here","New Account",pane.INFORMATION_MESSAGE); NewEmployeeDetails obj1=new NewEmployeeDetails(); obj1.setVisible(true); this.setVisible(false); }

private void jbtnCancelActionPerformed(java.awt.event.ActionEvent evt) { this.jtxtUserName.setText(" "); this.jtxtPassword.setText(" "); }

private void jbtnLoginActionPerformed(java.awt.event.ActionEvent evt) { String password=String.valueOf(this.jtxtPassword.getPassword()); try { String str="select EmployeeID from EmployeeDetails where EmployeeID='"+this.jtxtUserName.getText()+"'and password='"+password+"'"; rs=this.stmt.executeQuery(str); if(rs.next()) { pane.showMessageDialog(this,"Wel Come Mr "+this.jtxtUserName.getText()+" in Employee Page","Information",pane.INFORMATION_MESSAGE); EmployeePage objAdmin=new EmployeePage(this.jtxtUserName.getText()); objAdmin.setVisible(true); this.setVisible(false); } else { pane.showMessageDialog(this,"Admin ID and Password Not Matched","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"ERROR",pane.ERROR_MESSAGE); } }

private void jbtnLogOutActionPerformed(java.awt.event.ActionEvent evt) { MainPage obj1=new MainPage(); obj1.setVisible(true); this.setVisible(false); }

/** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() {

83

Page 84: MCA Project Report on JAVA Studio

Employee Transfer Management System

public void run() { new Employee_Login().setVisible(true); } }); }

// Variables declaration - do not modify 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; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JButton jbtnCancel; private javax.swing.JButton jbtnClickHere; private javax.swing.JButton jbtnLogOut; private javax.swing.JButton jbtnLogin; private javax.swing.JPasswordField jtxtPassword; private javax.swing.JTextField jtxtUserName; private javax.swing.JLabel lblTime; // End of variables declaration

}

84

Page 85: MCA Project Report on JAVA Studio

Employee Transfer Management System

EMPLOYEE PAGE

Source Code EmployeePage.java

/* * EmployeePage.java * * Created on August 26, 2009, 2:37 PM */

package Employee;import java.sql.*;import java.util.Date;import javax.swing.*;/** * * @author user */public class EmployeePage extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date; String Name; public EmployeePage(String n) { Name=n; date=new Date(); initComponents(); }

85

Page 86: MCA Project Report on JAVA Studio

Employee Transfer Management System

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jlblName = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jLabel9 = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jButton7 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jLabel1.setFont(new java.awt.Font("Bauhaus 93", 1, 48)); jLabel1.setForeground(new java.awt.Color(51, 102, 0)); jLabel1.setText(" Employee Transfer Management");

jLabel2.setFont(new java.awt.Font("Algerian", 1, 36)); jLabel2.setForeground(new java.awt.Color(0, 51, 204)); jLabel2.setText("Employee Page");

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel4.setText("jLabel2");

jLabel16.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\apenquin.gif"));

86

Page 87: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel16.setText("jLabel16");

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\apenquin.gif")); jLabel17.setText("jLabel16");

jLabel7.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\logo.gif")); jLabel7.setText("jLabel7");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel8.setFont(new java.awt.Font("Bauhaus 93", 1, 36)); jLabel8.setForeground(new java.awt.Color(102, 102, 0)); jLabel8.setText("WelCome Mr");

jlblName.setFont(new java.awt.Font("Bauhaus 93", 1, 36)); jlblName.setForeground(new java.awt.Color(204, 0, 0));

jPanel1.setBackground(new java.awt.Color(255, 0, 0)); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1001, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 16, Short.MAX_VALUE) );

jPanel3.setBackground(new java.awt.Color(102, 102, 0)); jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 0))); jLabel10.setFont(new java.awt.Font("Arial Black", 0, 18)); jLabel10.setForeground(new java.awt.Color(255, 255, 255)); jLabel10.setText(" Select Any Option Given In this Management");

org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(38, 38, 38) .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 518, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(38, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE) );

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

87

Page 88: MCA Project Report on JAVA Studio

Employee Transfer Management System

org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1001, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 16, Short.MAX_VALUE) );

jLabel5.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\big_flash_control_logo.gif")); jLabel5.setText("jLabel2");

jButton4.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton4.setText("Exit Project"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

jLabel9.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel9.setText("jLabel9");

jButton5.setFont(new java.awt.Font("Arial", 1, 14)); jButton5.setText("Log Out"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } });

jButton6.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton6.setText("Transfer Request"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } });

jLabel11.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel11.setText("jLabel9");

jLabel12.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel12.setText("jLabel9");

jButton7.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jButton7.setText("Searching Transfer"); jButton7.addActionListener(new java.awt.event.ActionListener() {

88

Page 89: MCA Project Report on JAVA Studio

Employee Transfer Management System

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

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(23, 23, 23) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 841, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(23, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(18, 18, 18) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(46, 46, 46) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 339, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(35, 35, 35) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 336, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(42, 42, 42) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(74, 74, 74) .add(jLabel8) .add(15, 15, 15) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 271, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 22, Short.MAX_VALUE) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(52, 52, 52)))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap()

89

Page 90: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 160, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(49, 49, 49) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jButton5)) .add(layout.createSequentialGroup() .add(74, 74, 74) .add(jButton6) .add(38, 38, 38) .add(jButton7) .add(40, 40, 40) .add(jButton4))) .add(16, 16, 16)) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap(117, Short.MAX_VALUE) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 773, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(111, 111, 111)) .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(15, 15, 15) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(16, 16, 16) .add(jLabel2) .add(27, 27, 27) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(15, 15, 15)

90

Page 91: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 190, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(15, 15, 15) .add(jLabel16, 0, 0, Short.MAX_VALUE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel7) .add(14, 14, 14) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 151, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(layout.createSequentialGroup() .add(16, 16, 16) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton5))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(23, 23, 23))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); pack(); }// </editor-fold>

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Search Employee Transfer Record Here","Information",pane.DEFAULT_OPTION); EmployeeTransferSearch obj1=new EmployeeTransferSearch(this.jlblName.getText()); obj1.setVisible(true);

91

Page 92: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.setVisible(false); }

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Add Your Transfer Request Here","Information",pane.DEFAULT_OPTION); EmployeeTransferRequest obj1=new EmployeeTransferRequest(this.jlblName.getText()); obj1.setVisible(true); this.setVisible(false); }

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); this.jlblName.setText(Name.toString()); }

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { Employee_Login obj1=new Employee_Login(); obj1.setVisible(true); this.setVisible(false); }

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { this.pane.showMessageDialog(this,"Thank You for Using This Project","Information",pane.DEFAULT_OPTION); System.exit(0); }

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

// Variables declaration - do not modify private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2;

92

Page 93: MCA Project Report on JAVA Studio

Employee Transfer Management System

private javax.swing.JPanel jPanel3; private javax.swing.JLabel jlblName; private javax.swing.JLabel jlblTime; // End of variables declaration

}

93

Page 94: MCA Project Report on JAVA Studio

Employee Transfer Management System

TRANSFER REQUEST

Source Code EmployeeTransferRequest.java

/* * EmployeeTransferRequest.java * * Created on August 27, 2009, 10:18 AM */

package Employee;import java.sql.*;import java.util.Date;import javax.swing.*;/** * * @author user */public class EmployeeTransferRequest extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date; String name; public EmployeeTransferRequest(String n) { name=n; date=new Date(); Connection(); initComponents(); }

94

Page 95: MCA Project Report on JAVA Studio

Employee Transfer Management System

void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jLabel18 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jtxtAdminName = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); jtxtAdminID = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jtxtCurrentProject = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jtxtCurrentLocation = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); jtxtTranserProject = new javax.swing.JTextField(); jLabel20 = new javax.swing.JLabel(); jtxtTransferLocation = new javax.swing.JTextField();

95

Page 96: MCA Project Report on JAVA Studio

Employee Transfer Management System

jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jtxtWorExperience = new javax.swing.JTextField(); jcboRole = new javax.swing.JComboBox(); jLabel27 = new javax.swing.JLabel(); jcboDepartment = new javax.swing.JComboBox(); jLabel21 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jPanel1.setBackground(new java.awt.Color(51, 51, 0)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 51))); jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 36)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText(" Employee Transfer Management ");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 663, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE) );

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel4.setText("jLabel2");

jLabel6.setFont(new java.awt.Font("Algerian", 1, 24)); jLabel6.setForeground(new java.awt.Color(0, 102, 0)); jLabel6.setText(" New Employee Details");

96

Page 97: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel16.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel16.setText("jLabel16");

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel17.setText("jLabel16");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jPanel2.setBackground(new java.awt.Color(255, 0, 153)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1003, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 17, Short.MAX_VALUE) );

jPanel3.setBackground(new java.awt.Color(255, 0, 153)); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 993, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 17, Short.MAX_VALUE) );

jPanel6.setBackground(new java.awt.Color(0, 0, 0)); jLabel18.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jLabel18.setForeground(new java.awt.Color(255, 255, 255)); jLabel18.setText(" Add Employee Transfer Request Here");

org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup() .add(47, 47, 47) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 399, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(56, Short.MAX_VALUE)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()

97

Page 98: MCA Project Report on JAVA Studio

Employee Transfer Management System

.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel18) .addContainerGap()) );

jPanel4.setBackground(new java.awt.Color(255, 255, 204)); jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 51))); jLabel7.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel7.setText("Employee Name");

jtxtAdminName.setEditable(false);

jLabel9.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel9.setText("Employee ID");

jtxtAdminID.setEditable(false);

jLabel10.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel10.setText("Employee Role");

jLabel12.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel12.setText("Work Experience");

jLabel13.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel13.setText("Current Project");

jLabel14.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel14.setText("Current Location");

jLabel19.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel19.setText("Transfer Project");

jLabel20.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel20.setText("Transfer Location");

jButton1.setFont(new java.awt.Font("Arial", 1, 14)); jButton1.setText("Add Details"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });

jButton2.setFont(new java.awt.Font("Arial", 1, 14)); jButton2.setText("Referesh"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });

jButton3.setFont(new java.awt.Font("Arial", 1, 14)); jButton3.setText("Exit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); }

98

Page 99: MCA Project Report on JAVA Studio

Employee Transfer Management System

});

jcboRole.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Project Developer", "Project Analizer", "Database Administrator", "End User" }));

jLabel27.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel27.setText("Department");

jcboDepartment.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Accounts", "Markting", "Executive", "Advertisment" }));

org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE) .add(jLabel9) .add(jLabel10) .add(jLabel12) .add(jLabel27)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jcboRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 164, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 187, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel4Layout.createSequentialGroup() .add(jtxtAdminID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jtxtWorExperience, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(jPanel4Layout.createSequentialGroup() .add(jcboDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 170, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(77, 77, 77) .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(17, 17, 17) .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(24, 24, 24) .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(65, 65, 65)

99

Page 100: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jLabel20, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel19, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jtxtCurrentProject, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtCurrentLocation) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtTranserProject) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtTransferLocation)))) .add(67, 67, 67)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(21, 21, 21) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel13) .add(jtxtCurrentProject, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel4Layout.createSequentialGroup() .add(173, 173, 173) .add(jLabel20)) .add(jPanel4Layout.createSequentialGroup() .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel14) .add(jtxtCurrentLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jtxtAdminID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel9)) .add(34, 34, 34) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel19) .add(jtxtTranserProject, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboRole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

100

Page 101: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel10)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 40, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jtxtTransferLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtWorExperience, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel12)))))) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel7) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel27) .add(jcboDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .addContainerGap(283, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jButton3) .add(jButton2) .add(jButton1)) .addContainerGap()) );

jLabel21.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel21.setText("jLabel16");

jLabel22.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel22.setText("jLabel16");

jLabel11.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel11.setText("jLabel9");

jLabel23.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel23.setText("jLabel9");

jLabel24.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif"));

101

Page 102: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel24.setText("jLabel9");

jLabel25.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel25.setText("jLabel9");

jLabel26.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\hearta.gif")); jLabel26.setText("jLabel9");

jButton4.setFont(new java.awt.Font("Arial", 1, 14)); jButton4.setText("Log Out"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap(59, Short.MAX_VALUE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(23, 23, 23) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(38, 38, 38) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 334, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(28, 28, 28) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 373, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(27, 27, 27) .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(24, 24, 24) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(20, 20, 20) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(28, 28, 28)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup()

102

Page 103: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .add(layout.createSequentialGroup() .add(45, 45, 45) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 24, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) .add(layout.createSequentialGroup() .add(jLabel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(45, 45, 45) .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(43, 43, 43) .add(jButton4) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 16, Short.MAX_VALUE) .add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19)))) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(33, 33, 33) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(50, 50, 50) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(32, 32, 32) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel16) .add(jLabel17)))

103

Page 104: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(layout.createSequentialGroup() .add(22, 22, 22) .add(jLabel6) .add(15, 15, 15) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createSequentialGroup() .add(23, 23, 23) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(14, 14, 14) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(16, 16, 16) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel21) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel22) .add(jButton4)) .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(27, 27, 27) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(22, 22, 22) .add(jLabel24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(20, 20, 20) .add(jLabel25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(27, 27, 27) .add(jLabel26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 28, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ); pack(); }// </editor-fold>

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); this.jtxtAdminID.setText(name.toString()); try

104

Page 105: MCA Project Report on JAVA Studio

Employee Transfer Management System

{ String str="select EmployeeName from EmployeeDetails where EmployeeID='"+this.jtxtAdminID.getText()+"'"; rs=this.stmt.executeQuery(str); if(rs.next()) { this.jtxtAdminName.setText(rs.getString(1)); } else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { EmployeePage obj1=new EmployeePage(this.jtxtAdminID.getText()); obj1.setVisible(true); this.setVisible(false); }

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { pane.showMessageDialog(this,"Thank You for Using this project","Conformation",pane.INFORMATION_MESSAGE); System.exit(0); }

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

this.jtxtAdminID.setText(" "); this.jtxtAdminName.setText(" "); this.jcboDepartment.setSelectedIndex(-1); this.jcboRole.setSelectedIndex(-1); this.jtxtCurrentProject.setText(" "); this.jtxtCurrentLocation.setText(" "); this.jtxtTranserProject.setText(" "); this.jtxtTransferLocation.setText(" "); this.jtxtWorExperience.setText(" ");

}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { String str="insert into EmployeeTransferRequest values('"+this.jtxtAdminID.getText()+"','"+this.jtxtAdminName.getText()+"','"+this.jcboRole.getSelectedItem()+"','"+this.jtxtWorExperience.getText()+"','"+this.jcboDepartment.getSelectedItem()+"','"+this.jtxtCurrentProject.getText()+"','"+this.jtxtCurrentLocation.getText()+"','"+this.jtxtTranserProject.getText()+"','"+this.jtxtTransferLocation.getText()+"')"; this.stmt.executeUpdate(str); pane.showMessageDialog(this,"Record are Successfully Added","Conformation",pane.INFORMATION_MESSAGE); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

105

Page 106: MCA Project Report on JAVA Studio

Employee Transfer Management System

}

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

// Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.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 jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; 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 jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JComboBox jcboDepartment; private javax.swing.JComboBox jcboRole; private javax.swing.JLabel jlblName; private javax.swing.JLabel jlblTime; private javax.swing.JTextField jtxtAdminID; private javax.swing.JTextField jtxtAdminName; private javax.swing.JTextField jtxtCurrentLocation; private javax.swing.JTextField jtxtCurrentProject; private javax.swing.JTextField jtxtTranserProject;

106

Page 107: MCA Project Report on JAVA Studio

Employee Transfer Management System

private javax.swing.JTextField jtxtTransferLocation; private javax.swing.JTextField jtxtWorExperience; // End of variables declaration

}

107

Page 108: MCA Project Report on JAVA Studio

Employee Transfer Management System

EMPLOYEE TRANSFER SEARCH

Source Code EmployeeTransferSearch.java

/* * EmployeeTransferSearch.java * * Created on August 28, 2009, 10:27 AM */

package Employee;

import java.sql.*;import java.util.Date;import javax.swing.*;/** * * @author user */public class EmployeeTransferSearch extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs; Date date;

108

Page 109: MCA Project Report on JAVA Studio

Employee Transfer Management System

String name; public EmployeeTransferSearch(String n) { name=n; date=new Date(); Connection(); initComponents(); } void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel();

109

Page 110: MCA Project Report on JAVA Studio

Employee Transfer Management System

jlblName = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jcboEmployeeID = new javax.swing.JComboBox(); jcboEmpName = new javax.swing.JComboBox(); jcboLocation = new javax.swing.JComboBox(); jcboToLocation = new javax.swing.JComboBox(); jcboFromDep = new javax.swing.JComboBox(); jcboToDep = new javax.swing.JComboBox(); jPanel5 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jlstID = new java.awt.List(); jlstName = new java.awt.List(); jlststCLoaction = new java.awt.List(); jlstCDepartment = new java.awt.List(); jLabel15 = new javax.swing.JLabel(); jlstTDepartment = new java.awt.List(); jlstTDate = new java.awt.List(); jLabel27 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); jlstJDate = new java.awt.List(); list9 = new java.awt.List(); jlstCLoaction = new java.awt.List(); jLabel30 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jPanel1.setBackground(new java.awt.Color(51, 51, 0)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 51))); jLabel2.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 36)); jLabel2.setForeground(new java.awt.Color(255, 255, 255));

110

Page 111: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel2.setText(" Employee Transfer Management ");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 710, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(41, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE) );

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel4.setText("jLabel2");

jLabel6.setFont(new java.awt.Font("Arial Black", 1, 24)); jLabel6.setForeground(new java.awt.Color(204, 0, 0)); jLabel6.setText(" Employee transfer Search Details");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel17.setText("jLabel16");

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel18.setText("jLabel16");

jPanel2.setBackground(new java.awt.Color(0, 153, 51)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);

111

Page 112: MCA Project Report on JAVA Studio

Employee Transfer Management System

jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 1019, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 15, Short.MAX_VALUE) );

jLabel8.setFont(new java.awt.Font("Bodoni MT Black", 0, 24)); jLabel8.setForeground(new java.awt.Color(0, 0, 204)); jLabel8.setText("Wel come Mr ");

jlblName.setFont(new java.awt.Font("Bodoni MT Black", 0, 24)); jlblName.setForeground(new java.awt.Color(0, 102, 51));

jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 204))); jLabel20.setFont(new java.awt.Font("Arial Black", 1, 14)); jLabel20.setForeground(new java.awt.Color(255, 0, 0)); jLabel20.setText(" Searching The Transfer Records with Different Option");

jLabel21.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel21.setText("Employee ID");

jLabel22.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel22.setText("Employee Name");

jLabel23.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel23.setText("From Location");

jLabel24.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel24.setText("To Location");

jLabel25.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel25.setText("From Department");

jLabel26.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel26.setText("To Department");

jcboEmployeeID.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboEmployeeID.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboEmployeeIDActionPerformed(evt); }

112

Page 113: MCA Project Report on JAVA Studio

Employee Transfer Management System

});

jcboEmpName.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboEmpName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboEmpNameActionPerformed(evt); } });

jcboLocation.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboLocation.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboLocationActionPerformed(evt); } });

jcboToLocation.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboToLocation.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboToLocationActionPerformed(evt); } });

jcboFromDep.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboFromDep.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboFromDepActionPerformed(evt); } });

jcboToDep.setFont(new java.awt.Font("Berlin Sans FB Demi", 1, 14)); jcboToDep.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcboToDepActionPerformed(evt); } });

org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .addContainerGap() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup()

113

Page 114: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jcboEmployeeID, 0, 120, Short.MAX_VALUE) .add(jLabel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(31, 31, 31) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel22, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jcboEmpName, 0, 133, Short.MAX_VALUE)) .add(41, 41, 41) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 133, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 125, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboToLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(19, 19, 19) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 153, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboFromDep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 140, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jcboToDep, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel26, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)) .add(56, 56, 56))

114

Page 115: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jLabel20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 537, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(177, 177, 177)))) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jLabel20) .add(11, 11, 11) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel23) .add(jLabel24) .add(jLabel21) .add(jLabel25) .add(jLabel22) .add(jLabel26)) .add(20, 20, 20) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jcboEmployeeID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboEmpName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboToLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboFromDep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jcboToDep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(12, Short.MAX_VALUE)) );

jPanel5.setBackground(new java.awt.Color(255, 255, 204)); jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 0))); jLabel9.setFont(new java.awt.Font("Arial Black", 0, 14));

115

Page 116: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel9.setText("Employee ID");

jLabel10.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel10.setText("Employee Name");

jLabel11.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel11.setText("Current Location");

jLabel16.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel16.setText("Current Department");

jLabel15.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel15.setText("Transfer Department");

jLabel27.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel27.setText("Transfer Revling Date");

jLabel28.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel28.setText("Transfer Joining Date");

jLabel30.setFont(new java.awt.Font("Arial Black", 0, 14)); jLabel30.setText("Transfer Location");

jButton4.setFont(new java.awt.Font("Arial", 1, 14)); jButton4.setText("Log Out"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

jButton3.setFont(new java.awt.Font("Arial", 1, 14)); jButton3.setText("Exit Project"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });

org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup()

116

Page 117: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel5Layout.createSequentialGroup() .add(43, 43, 43) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 133, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 133, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(33, 33, 33)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 133, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel16)) .add(21, 21, 21))) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jlstName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE) .add(jlstID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE) .add(jlstCDepartment, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE) .add(jlststCLoaction, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)) .add(39, 39, 39) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jLabel28, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel27, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

117

Page 118: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel15, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(34, 34, 34) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jlstTDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlstTDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlstJDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel5Layout.createSequentialGroup() .add(jLabel30) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jlstCLoaction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(21, 21, 21) .add(jButton4)) .add(jPanel5Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jButton3)))) .add(list9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(28, 28, 28) .add(jLabel15) .add(62, 62, 62) .add(jLabel27) .add(71, 71, 71) .add(jLabel28) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 64, Short.MAX_VALUE) .add(jLabel30) .add(31, 31, 31))

118

Page 119: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5Layout.createSequentialGroup() .add(list9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(28, 28, 28) .add(jButton4)) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .addContainerGap() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jlstTDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 60, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlstID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 60, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel5Layout.createSequentialGroup() .add(29, 29, 29) .add(jLabel9))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(45, 45, 45) .add(jLabel10)) .add(jPanel5Layout.createSequentialGroup() .add(20, 20, 20) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jlstTDate, 0, 0, Short.MAX_VALUE) .add(jlstName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)))))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(46, 46, 46) .add(jLabel11)) .add(jPanel5Layout.createSequentialGroup() .add(20, 20, 20)

119

Page 120: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jlstJDate, 0, 0, Short.MAX_VALUE) .add(jlststCLoaction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .add(jLabel16) .add(26, 26, 26)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jlstCLoaction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 60, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlstCDepartment, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jButton3)) .addContainerGap()))) );

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap()

120

Page 121: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(29, 29, 29) .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(layout.createSequentialGroup() .add(15, 15, 15) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(24, 24, 24) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 95, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(jlblTime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(154, 154, 154) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 515, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 130, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()

121

Page 122: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(10, 10, 10) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(21, 21, 21) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(14, 14, 14) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

122

Page 123: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jlblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(layout.createSequentialGroup() .add(22, 22, 22) .add(jLabel17))) .add(jLabel18)))))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(15, 15, 15) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 342, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(72, 72, 72)) ); pack(); }// </editor-fold>

private void jcboToDepActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where TransferDepartment='"+this.jcboToDep.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do

123

Page 124: MCA Project Report on JAVA Studio

Employee Transfer Management System

{ this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt); this.jlststCLoaction.add(rs.getString(3),cnt); this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jcboFromDepActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where CurrentDepartment='"+this.jcboFromDep.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do {

124

Page 125: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt); this.jlststCLoaction.add(rs.getString(3),cnt); this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jcboToLocationActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where TransferLocation='"+this.jcboToLocation.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do { this.jlstID.add(rs.getString(1),cnt);

125

Page 126: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.jlstName.add(rs.getString(2),cnt); this.jlststCLoaction.add(rs.getString(3),cnt); this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jcboLocationActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where CurrentLocation='"+this.jcboLocation.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do { this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt);

126

Page 127: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.jlststCLoaction.add(rs.getString(3),cnt); this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jcboEmpNameActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where EmployeeName='"+this.jcboEmpName.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do { this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt); this.jlststCLoaction.add(rs.getString(3),cnt);

127

Page 128: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jcboEmployeeIDActionPerformed(java.awt.event.ActionEvent evt) { this.jlstID.removeAll(); this.jlstName.removeAll(); this.jlststCLoaction.removeAll(); this.jlstCDepartment.removeAll(); this.jlstTDepartment.removeAll(); this.jlstCLoaction.removeAll(); this.jlstTDate.removeAll(); this.jlstJDate.removeAll(); try { String str="select EmployeeID,EmployeeName,CurrentLocation,CurrentDepartment,TransferDepartment,TransferLocation,TransferRelivingDate,TransferJoiningDate from EmployeeTransferDetails where EmployeeID='"+this.jcboEmployeeID.getSelectedItem()+"'"; rs=this.stmt.executeQuery(str); pane.showMessageDialog(this,"Record Found","Information",pane.INFORMATION_MESSAGE); if(rs.next()) { int cnt=0; do { this.jlstID.add(rs.getString(1),cnt); this.jlstName.add(rs.getString(2),cnt); this.jlststCLoaction.add(rs.getString(3),cnt);

128

Page 129: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.jlstCDepartment.add(rs.getString(4),cnt); this.jlstTDepartment.add(rs.getString(5),cnt); this.jlstCLoaction.add(rs.getString(6),cnt); this.jlstTDate.add(rs.getString(7),cnt); this.jlstJDate.add(rs.getString(8),cnt);

cnt++; }while(rs.next()); } else { pane.showMessageDialog(this,"Record Not Found","Error",pane.ERROR_MESSAGE); } } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { pane.showMessageDialog(this,"Thank You for Using this project","Conformation",pane.INFORMATION_MESSAGE); System.exit(0); }

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { MainPage obj1=new MainPage(); obj1.setVisible(true); this.setVisible(false); }

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); this.jlblName.setText(name.toString()); try { String str="select distinct EmployeeID from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do { this.jcboEmployeeID.insertItemAt(rs.getString(1),cnt);

cnt++; }while(rs.next());

129

Page 130: MCA Project Report on JAVA Studio

Employee Transfer Management System

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="select distinct EmployeeName from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do {

this.jcboEmpName.insertItemAt(rs.getString(1),cnt);

cnt++; }while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="select distinct CurrentLocation from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do {

this.jcboLocation.insertItemAt(rs.getString(1),cnt);

cnt++;

130

Page 131: MCA Project Report on JAVA Studio

Employee Transfer Management System

}while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="select distinct TransferLocation from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do {

this.jcboToLocation.insertItemAt(rs.getString(1),cnt);

cnt++; }while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="select distinct CurrentDepartment from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do {

this.jcboFromDep.insertItemAt(rs.getString(1),cnt);

131

Page 132: MCA Project Report on JAVA Studio

Employee Transfer Management System

cnt++; }while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="select distinct TransferDepartment from EmployeeTransferDetails"; rs=this.stmt.executeQuery(str); if(rs.next()) { int cnt=0; do {

this.jcboToDep.insertItemAt(rs.getString(1),cnt); cnt++; }while(rs.next());

} else { pane.showMessageDialog(this,"Record Not Found","ERROR",pane.ERROR_MESSAGE); } }catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

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

132

Page 133: MCA Project Report on JAVA Studio

Employee Transfer Management System

}); }

// Variables declaration - do not modify private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel30; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JComboBox jcboEmpName; private javax.swing.JComboBox jcboEmployeeID; private javax.swing.JComboBox jcboFromDep; private javax.swing.JComboBox jcboLocation; private javax.swing.JComboBox jcboToDep; private javax.swing.JComboBox jcboToLocation; private javax.swing.JLabel jlblName; private javax.swing.JLabel jlblTime; private java.awt.List jlstCDepartment; private java.awt.List jlstCLoaction; private java.awt.List jlstID; private java.awt.List jlstJDate; private java.awt.List jlstName; private java.awt.List jlstTDate; private java.awt.List jlstTDepartment; private java.awt.List jlststCLoaction; private java.awt.List list9;

133

Page 134: MCA Project Report on JAVA Studio

Employee Transfer Management System

// End of variables declaration

}

134

Page 135: MCA Project Report on JAVA Studio

Employee Transfer Management System

NEW EMPLOYEE DETAILS

Source Code NewEmployeeDetails.java

/* * NewEmployeeDetails.java * * Created on August 26, 2009, 1:52 PM */

package Employee;import java.sql.*;import java.util.Date;import javax.swing.*;/** * * @author user */public class NewEmployeeDetails extends javax.swing.JFrame {

JOptionPane pane; Statement stmt; Connection con; ResultSet rs;

135

Page 136: MCA Project Report on JAVA Studio

Employee Transfer Management System

Date date; public NewEmployeeDetails() { date=new Date(); Connection(); initComponents(); } void Connection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException es) { pane.showMessageDialog(this,"Class Not Found"+es.toString(),"Error",pane.ERROR_MESSAGE); } try { String str="Jdbc:Odbc:Employee"; con=DriverManager.getConnection(str); this.stmt=con.createStatement(); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); }

}

/** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jlblTime = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel();

136

Page 137: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel18 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jtxtAdminName = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jtxtAdminID = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jtxtAddress = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jtxtCity = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); jtxtPhoneNo = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jtxtEmail = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jtxtPassword = new javax.swing.JPasswordField(); jtxtRetype = new javax.swing.JPasswordField(); jPanel3 = new javax.swing.JPanel(); jButton4 = new javax.swing.JButton(); jLabel21 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });

jPanel1.setBackground(new java.awt.Color(51, 51, 0)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 51))); jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 36)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText(" Employee Transfer Management ");

org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);

137

Page 138: MCA Project Report on JAVA Studio

Employee Transfer Management System

jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 663, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE) );

jLabel2.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel2.setText("jLabel2");

jLabel3.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\silverclock04.gif")); jLabel3.setText("jLabel2");

jLabel4.setFont(new java.awt.Font("Algerian", 1, 24)); jLabel4.setForeground(new java.awt.Color(0, 102, 0)); jLabel4.setText(" New Employee Details");

jlblTime.setFont(new java.awt.Font("Baskerville Old Face", 1, 18));

jLabel16.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel16.setText("jLabel16");

jLabel17.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel17.setText("jLabel16");

jPanel5.setBackground(new java.awt.Color(0, 0, 0)); jLabel15.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 18)); jLabel15.setForeground(new java.awt.Color(255, 255, 255)); jLabel15.setText(" Add Admin New Details Here");

138

Page 139: MCA Project Report on JAVA Studio

Employee Transfer Management System

org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(47, 47, 47) .add(jLabel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 399, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(56, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel15) .addContainerGap()) );

jPanel2.setBackground(new java.awt.Color(255, 0, 51)); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 994, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 15, Short.MAX_VALUE) );

jLabel18.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\siteseal_gd_dv_medium.gif")); jLabel18.setText("jLabel16");

jPanel4.setBackground(new java.awt.Color(255, 255, 204)); jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 51))); jLabel5.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel5.setText("Employee Name");

139

Page 140: MCA Project Report on JAVA Studio

Employee Transfer Management System

jLabel6.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 12)); jLabel6.setForeground(new java.awt.Color(204, 0, 51)); jLabel6.setText("Employee ID Must be Unique");

jLabel7.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel7.setText("Employee ID");

jLabel8.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel8.setText("Employee Password");

jLabel9.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 12)); jLabel9.setForeground(new java.awt.Color(204, 0, 51)); jLabel9.setText("Employee Password Must be Unique");

jLabel10.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel10.setText("Retype Password");

jLabel11.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel11.setText("Address");

jLabel12.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel12.setText("City");

jLabel13.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel13.setText("Phone No");

jLabel14.setFont(new java.awt.Font("Baskerville Old Face", 1, 18)); jLabel14.setText("Email");

jButton1.setFont(new java.awt.Font("Arial", 1, 14)); jButton1.setText("Add Details"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });

jButton2.setFont(new java.awt.Font("Arial", 1, 14)); jButton2.setText("Referesh"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });

jButton3.setFont(new java.awt.Font("Arial", 1, 14)); jButton3.setText("Exit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {

140

Page 141: MCA Project Report on JAVA Studio

Employee Transfer Management System

jButton3ActionPerformed(evt); } });

jtxtRetype.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jtxtRetypeFocusLost(evt); } });

org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel4Layout.createSequentialGroup() .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE) .add(16, 16, 16) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 182, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup() .add(jLabel10) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 41, Short.MAX_VALUE) .add(jtxtRetype, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7) .add(jLabel8)) .add(19, 19, 19) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jtxtAdminID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)

141

Page 142: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jtxtPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE))))) .add(jPanel4Layout.createSequentialGroup() .add(59, 59, 59) .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 224, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createSequentialGroup() .add(75, 75, 75) .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 214, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 51, Short.MAX_VALUE) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel13, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel12, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel11, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtCity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtPhoneNo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jtxtEmail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 169, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createSequentialGroup()

142

Page 143: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(14, 14, 14) .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 7, Short.MAX_VALUE) .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(42, 42, 42)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel11) .add(jLabel5) .add(jtxtAdminName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel4Layout.createSequentialGroup() .add(16, 16, 16) .add(jLabel6) .add(18, 18, 18) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jLabel7) .add(jtxtAdminID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(46, 46, 46) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8) .add(jtxtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))

143

Page 144: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(19, 19, 19) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel9) .add(jLabel14))) .add(jPanel4Layout.createSequentialGroup() .add(29, 29, 29) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtCity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel12)) .add(34, 34, 34) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtxtPhoneNo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel13)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jtxtEmail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel4Layout.createSequentialGroup() .add(23, 23, 23) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel10) .add(jtxtRetype, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(22, Short.MAX_VALUE)) .add(jPanel4Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jButton1) .add(jButton2) .add(jButton3)) .addContainerGap()))) );

jPanel3.setBackground(new java.awt.Color(255, 0, 51)); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);

144

Page 145: MCA Project Report on JAVA Studio

Employee Transfer Management System

jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 994, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 15, Short.MAX_VALUE) );

jButton4.setFont(new java.awt.Font("Arial", 1, 14)); jButton4.setText("Back"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } });

jLabel21.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel21.setText("jLabel17");

jLabel22.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel22.setText("jLabel17");

jLabel23.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel23.setText("jLabel17");

jLabel24.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel24.setText("jLabel17");

jLabel25.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel25.setText("jLabel17");

jLabel26.setIcon(new javax.swing.ImageIcon("E:\\Anil Suman,Kapil Rajta,Sunil Chauhan,Devin\\Employee Transfer Managment\\EmployeeTransferManagment\\image\\val003.gif")); jLabel26.setText("jLabel17");

145

Page 146: MCA Project Report on JAVA Studio

Employee Transfer Management System

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(17, 17, 17) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 35, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(jLabel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(35, 35, 35) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 373, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(49, 49, 49) .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 334, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, Short.MAX_VALUE) .add(jLabel17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(21, 21, 21))) .add(13, 13, 13) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(26, 26, 26)) .add(layout.createSequentialGroup() .add(20, 20, 20)

146

Page 147: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 123, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(70, 70, 70) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(58, 58, 58) .add(jButton4) .addContainerGap(154, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(22, 22, 22) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(13, 13, 13) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(10, 10, 10) .add(jLabel26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(17, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(29, 29, 29)

147

Page 148: MCA Project Report on JAVA Studio

Employee Transfer Management System

.add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(17, 17, 17) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel17) .add(layout.createSequentialGroup() .add(jLabel4) .add(22, 22, 22) .add(jlblTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jLabel16))) .add(layout.createSequentialGroup() .add(19, 19, 19) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(24, 24, 24) .add(jLabel18)) .add(layout.createSequentialGroup() .add(10, 10, 10) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jButton4) .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup()

148

Page 149: MCA Project Report on JAVA Studio

Employee Transfer Management System

.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(33, 33, 33) .add(jLabel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createSequentialGroup() .add(108, 108, 108) .add(jLabel24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 33, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold>

private void formWindowOpened(java.awt.event.WindowEvent evt) { this.jlblTime.setText(this.date.toString()); }

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { Employee_Login obj1=new Employee_Login(); obj1.setVisible(true);

149

Page 150: MCA Project Report on JAVA Studio

Employee Transfer Management System

this.setVisible(false); }

private void jtxtRetypeFocusLost(java.awt.event.FocusEvent evt) { String Password=String.valueOf(this.jtxtPassword.getPassword()); String Retype=String.valueOf(this.jtxtRetype.getPassword()); if(Retype.equals(Password)) { Retype=" "; } else { pane.showMessageDialog(this,"Password Does Not Matched","Error",pane.ERROR_MESSAGE); } }

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { pane.showMessageDialog(this,"Thank You for Using this project","Conformation",pane.INFORMATION_MESSAGE); System.exit(0); }

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { this.jtxtAddress.setText(" "); this.jtxtAdminID.setText(" "); this.jtxtAdminName.setText(" "); this.jtxtCity.setText(" "); this.jtxtPassword.setText(" "); this.jtxtPhoneNo.setText(" "); this.jtxtRetype.setText(" "); this.jtxtEmail.setText(" "); }

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String Password=String.valueOf(this.jtxtPassword.getPassword()); String Retype=String.valueOf(this.jtxtRetype.getPassword()); try { String str="insert into EmployeeDetails values('"+this.jtxtAdminName.getText()+"','"+this.jtxtAdminID.getText()+"','"+Password+"','"+Retype+"','"+this.jtxtAddress.getText()+"','"+this.jtxtCity.getText()+"','"+this.jtxtPhoneNo.getText()+"','"+this.jtxtEmail.getText()+"')"; this.stmt.executeUpdate(str); pane.showMessageDialog(this,"Record are Successfully Added","Conformation",pane.INFORMATION_MESSAGE); } catch(SQLException es) { pane.showMessageDialog(this,"SQL Error"+es.toString(),"Error",pane.ERROR_MESSAGE); } }

150

Page 151: MCA Project Report on JAVA Studio

Employee Transfer Management System

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

// Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.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 jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JLabel jlblTime; private javax.swing.JTextField jtxtAddress; private javax.swing.JTextField jtxtAdminID; private javax.swing.JTextField jtxtAdminName;

151

Page 152: MCA Project Report on JAVA Studio

Employee Transfer Management System

private javax.swing.JTextField jtxtCity; private javax.swing.JTextField jtxtEmail; private javax.swing.JPasswordField jtxtPassword; private javax.swing.JTextField jtxtPhoneNo; private javax.swing.JPasswordField jtxtRetype; // End of variables declaration

}

152

Page 153: MCA Project Report on JAVA Studio

Employee Transfer Management System

10. TESTING

Software Testing

Software Testing is an empirical investigation conducted to provide

stakeholders with information about the quality of the product or service under test,

with respect to the context in which it is intended to operate. Software Testing also

provides an objective, independent view of the software to allow the business to

appreciate and understand the risks at implementation of the software. Test

techniques include, but are not limited to, the process of executing a program or

application with the intent of finding software bugs. Software Testing can also be

stated as the process of validating and verifying that a software

program/application/product

meets the business and technical requirements that guided its design

and development;

works as expected; and

can be implemented with the same characteristics.

Software Testing, depending on the testing method employed, can be

implemented at any time in the development process, however most of the test

effort occurs after the requirements have been defined and the coding process has

been completed

Testing methods

Software testing methods are traditionally divided into black box testing

and white box testing. These two approaches are used to describe the point of view

that a test engineer takes when designing test cases.

Black box testing

Black box testing treats the software as a "black box"—without any

knowledge of internal implementation. Black box testing methods include:

equivalence partitioning, boundary value analysis, all-pairs testing, fuzz testing,

model-based testing, traceability matrix, exploratory testing and specification-

based testing.

153

Page 154: MCA Project Report on JAVA Studio

Employee Transfer Management System

Specification-based testing:

Specification-based testing aims to test the functionality of software

according to the applicable requirements. Thus, the tester inputs data into, and only

sees the output from, the test object. This level of testing usually requires thorough

test cases to be provided to the tester, who then can simply verify that for a given

input, the output value (or behavior), either "is" or "is not" the same as the

expected value specified in the test case.

Specification-based testing is necessary, but it is insufficient to guard

against certain risks.

Advantages and disadvantages

The black box tester has no "bonds" with the code, and a tester's perception

is very simple: a code must have bugs. Using the principle, "Ask and you shall

receive," black box testers find bugs where programmers do not. But, on the other

hand, black box testing has been said to be "like a walk in a dark labyrinth without

a flashlight," because the tester doesn't know how the software being tested was

actually constructed. As a result, there are situations when (1) a tester writes many

test cases to check something that could have been tested by only one test case,

and/or (2) some parts of the back-end are not tested at all.

Therefore, black box testing has the advantage of "an unaffiliated opinion,"

on the one hand, and the disadvantage of "blind exploring," on the other.

White box testing

White box testing is when the tester has access to the internal data

structures and algorithms including the code that implement these.

Types of white box testing

API testing (application programming interface) - Testing of the

application using Public and Private APIs

Code coverage - creating tests to satisfy some criteria of code coverage

(e.g., the test designer can create tests to cause all statements in the

program to be executed at least once)

154

Page 155: MCA Project Report on JAVA Studio

Employee Transfer Management System

Fault injection methods - improving the coverage of a test by

introducing faults to test code paths

Mutation testing methods

Static testing - White box testing includes all static testing

A sample testing cycle

Although variations exist between organizations, there is a typical cycle for

testing:

Requirements analysis: Testing should begin in the requirements

phase of the software development life cycle. During the design phase,

testers work with developers in determining what aspects of a design

are testable and with what parameters those tests work.

Test planning: Test strategy, test plan, tested creation. Since many

activities will be carried out during testing, a plan is needed.

Test development: Test procedures, test scenarios, test cases, test

datasets, test scripts to use in testing software.

Test execution: Testers execute the software based on the plans and

tests and report any errors found to the development team.

Test reporting: Once testing is completed, testers generate metrics and

make final reports on their test effort and whether or not the software

tested is ready for release.

Test result analysis: Or Defect Analysis, is done by the development

team usually along with the client, in order to decide what defects

should be treated, fixed, rejected (i.e. found software working properly)

or deferred to be dealt with later.

Defect Retesting: Once a defect has been dealt with by the

development team, it is retested by the testing team.

Regression testing: It is common to have a small test program built of

a subset of tests, for each integration of new, modified, or fixed

software, in order to ensure that the latest delivery has not ruined

155

Page 156: MCA Project Report on JAVA Studio

Employee Transfer Management System

anything, and that the software product as a whole is still working

correctly.

Test Closure: Once the test meets the exit criteria, the activities such as

capturing the key outputs, lessons learned, results, logs, documents

related to the project are archived and used as a reference for future

projects.

156

Page 157: MCA Project Report on JAVA Studio

Employee Transfer Management System

Login Forms Testing

(When Unauthorizeduser try to access the system)

Error Description Requirement

User name &

Password Not

Matched

Error occurred due to

authorization failure

Correct Username

& Password with

store name

selection

157

Page 158: MCA Project Report on JAVA Studio

Employee Transfer Management System

158

Page 159: MCA Project Report on JAVA Studio

Employee Transfer Management System

Employee Transfer Search Details

(When Employee ID or Employee Name or Location will left

blank)

Error Description Requirement

Record Not Found Error occurred due to

select invalid Employee

ID, Name, Location,

Department etc. or item

code when left blank

Enter a valid

Employee ID, Name,

Location,

Department etc.

159

Page 160: MCA Project Report on JAVA Studio

Employee Transfer Management System

New Employee Details

(When some of required fields are left blank)

Error Description Requirement

Please Enter All

Required Fields

Error occurred if some of

the some required fields

are left blank

Fill all the

information in

required fields.

160

Page 161: MCA Project Report on JAVA Studio

Employee Transfer Management System

11. SYSTEM IMPLEMENTATION

System Implementation means the process of converting a new or a revised

system design into an operational one. One aspect of implementation is conversion

and another aspect is the post implementation review and software maintenance.

The purpose of System Implementation is to make the new system available

to a prepared set of users (the deployment), and positioning on-going support and

maintenance of the system within the Performing Organization (the transition). At

a finer level of detail, deploying the system consists of executing all steps

necessary to educate the Consumers on the use of the new system, placing the

newly developed system into production, confirming that all data required at the

start of operation is available and accurate, and validating that business functions

that interact with the system are functioning properly. Transitioning the system

support responsibilities involves changing from a system development to a system

support and maintenance mode of operation, with ownership of the new system

moving from the Project Team to the Performing Organization.

A key difference between System Implementation and all other phases of the

lifecycle is that all project activities up to this point have been performed in safe,

protected, and secure environments, where project issues that arise have little or no

impact on day-to-day business operations. Once the system goes live, however,

this is no longer the case. Any miscues at this point will almost certainly translate

into direct operational and/or financial impacts on the Performing Organization. It

is through the careful planning, execution, and management of System

Implementation activities that the Project Team can minimize the likelihood of

these occurrences, and determine appropriate contingency plans in the event of a

problem.

Following standards have been followed while developing the system:

Design Standards

Developments Standards

Documentation Standards

161

Page 162: MCA Project Report on JAVA Studio

Employee Transfer Management System

Implementation is achieved if we have put all the standards in the project

development. Its aim is to convert design standards into real application that is user

friendly and easy to understand. Proper user manuals have been constructed for

users to be acquainted with the system.

162

Page 163: MCA Project Report on JAVA Studio

Employee Transfer Management System

12. SOFTWARE MAINTENANCE

Software Maintenance is a task that every software development group has to

face when the software is delivered to the customer’s site, installed & operational.

Therefore, delivery or release of software inaugurates the maintenance phase of the

life cycle. The time spent & effort required keeping software operational after

release is a very significant & consumes about 40-70% of the cost of entire life

cycle.

Maintenance of this system is entirely depends on the future requirements. In

future we may get new type of requirement from the client side then for that we

have make changes.

Before the future enhancements we need to have back up of the system and

its log files so that if in future system crashes then the system be replaced and

corrected this way we can have system maintained as it is.

To perform maintenance we must perform a detailed planning of the

maintenance process so that we can make necessary adjustments in budgets,

workings etc.

Types of maintenance

Adaptive

Corrective

Preventive

Predictive

163

Page 164: MCA Project Report on JAVA Studio

Employee Transfer Management System

13. LIMITATIONS OF THE PROJECT

This project is developed for single user. Only single user can use the

software i.e. the system is standalone and don’t have network support. So, that the

database is decentralized which result, the high data redundancy, have complex i.e.

tough to maintain and not economic.

This project is also not support multitasking, means if a user is working on

a form, he/she cannot open another form. First he has to complete his work on the

current form and then he can switch to another form. This project is made for only

partial fulfillment of BCA degree, it is not really implemented in any organisation.

In this project all information about Employee Transfer Management System is not

consider.

164

Page 165: MCA Project Report on JAVA Studio

Employee Transfer Management System

14. FUTURE SCOPE

This project can be used in many organizations after adding some more

useful modules in the project for which Human Resource Department are

providing services.

This project can be developed for online services, by which any employee

can see its details anytime-anywhere.

This project can be developed with centralized database so that data storage

and backup services will be easy.

165

Page 166: MCA Project Report on JAVA Studio

Employee Transfer Management System

BIBLIOGRAPHY

Books:

E.Balagurusamy, “Programming with Java: A Primer”, 4th Edition,

McGrawHill Publication, 2010.

Herbert Schildt, “The Complete Reference Java2”, 5th Edition,

McGrawHill Publication, 2002.

Gail Anderson and Paul Anderson, “Java Studio Creator Field

Guide”, 2nd Edition, Prentice-Hall, Inc., 2004.

Elias M. Awad, “Systems Analysis and Design”, 2nd Edition, Galgotia

Publication, 2008.

Petkovi, “Microsoft Sql Server 2005: A Beginner’s Guide”, Tata McGraw-

Hill, 2006

IGNOU, “CS-05 Elements of System Analysis and Design”.

IGNOU, “CS-67 RDBMS LAB Book 1”.

IGNOU, “CS-70 Introduction to Software Engineering”.

IGNOU, “CS-74 Introduction to Internet Programming”.

Websites:

http://javalessons.com/

http://http://javabeginner.com/

http://netbeans.org/kb/articles/learn-java.html

http://www.roseindia.net/

166