Professional Documents
Culture Documents
Login page:
package employee.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
JTextField input;
JTextField inpass;
Login(){
getContentPane().setBackground(Color.WHITE);
setLayout(null); //these is done to specify our own layout
setSize(550,350);
setLocation(400,65);
setVisible(true);
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import com.toedter.calendar.JDateChooser;
import java.util.*;
// **********************************************
JLabel designation = new JLabel("Designation ");
designation.setBounds(40, 360, 150, 90);
designation.setFont(new Font("serif",Font.PLAIN,20));
add(designation);
String degree[] =
{"PHD","B.Tech","M.Tech","BCA","MCA","BBA","MBA","M.Sc","B.Sc","B.com","M.co
m","BA","MA"};
JLabel edu = new JLabel("Higest Education ");
edu.setBounds(400, 390, 150, 30);
edu.setFont(new Font("serif" , Font.PLAIN,20));
add(edu);
// by using JComboBox and Choose class we can create dropdown menu.
JComboBox hedu = new JComboBox(degree);
hedu.setBounds(620, 390, 150, 30);
add(hedu);
hedu.setBackground(Color.white);
setLayout(null);
getContentPane().setBackground(Color.WHITE);
setSize(900,700);
setVisible(true);
setLocation(240,10);
}
public static void main(String args[]){
new AddEmp();
}
}
Home:
package employee.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
setLayout(null);
setSize(1120,630);
setVisible(true);
setLocation(105,40);
}
public void actionPerformed( ActionEvent ae){
if(ae.getSource() == add){
setVisible(false);
new AddEmp();
}else if(ae.getSource() == remove){
}else{
}
}
public static void main(String args[]){
new Home();
}
}
//in aove there are 4 buttons to recognize which button is clicked we have to use ae and
getSource() methode
//that will return the object of the button on which click event is happend
connect:
package employee.management.system;
import java.sql.*;
Connection con ;
Statement s ;
Conn(){
try{
Class.forName("com.mysql.cj.jdbc.Driver");
con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/employeemanagementsystem" ,"root","dhananjay@963" );
s = con.createStatement();
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String args[]){
new Conn();
}
}
splash:
package employee.management.system;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
// Im below section image is grabed as imagicon and converted to image for scalling
purpouse and then
// scaledimge is converted into imageicon to add these image into the frame we have to
make object of jlael
// ie. add only accepts the jlabel object.
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/front.jpg"));
Image i2 = i1.getImage().getScaledInstance(1100,700,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(150, 130, 1050, 500); //image diemensions are set
add(image);
// button is created using jbutton class and then to display button relative to the position
of
// image we used image.add(button)
JButton click = new JButton("CLICK TO CONTINUE");
click.setBounds(400, 400, 250, 40);
image.add(click);
click.addActionListener(this);
setSize(1170,650);
setLocation(30,20);
setVisible(true);
}
public void actionPerformed(ActionEvent e){
setVisible(false);
new Login();
}
public static void main(String[] args){
new Splash();
}
}