-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFront.java
More file actions
85 lines (71 loc) · 2.46 KB
/
Front.java
File metadata and controls
85 lines (71 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Employ_Management_System;
import javax.swing.*;
import java.awt.*;
import java.lang.Thread;
import java.awt.event.*; //This package is used to define the event that will happen upon clicking the button on frontscreen
/**
*
* @author chirag goyal
*/
public class Front implements ActionListener {
JFrame fro;
JLabel id,l1;
JButton bu;
Front(){
fro=new JFrame("Employ Management System");
fro.setBackground(Color.RED);
fro.setLayout(null);
ImageIcon i1=new ImageIcon(ClassLoader.getSystemResource("Employ_Management_System/images/front_page.jpeg"));
Image i2=i1.getImage().getScaledInstance(1200,550,Image.SCALE_DEFAULT);
ImageIcon i3=new ImageIcon(i2);
JLabel l1=new JLabel(i3);
l1.setBounds(0,180,1360,530);
fro.add(l1);
bu=new JButton("CLICK HERE TO PROCEED");
bu.setBackground(Color.BLACK);
bu.setForeground(Color.WHITE);
bu.setBounds(500,600,300,70);
bu.addActionListener(this);
id=new JLabel();
id.setBounds(0,0,1360,750);
id.setLayout(null);
JLabel l=new JLabel("EMPLOYEE MANAGEMENT SYSTEM");
l.setBounds(80,30,1500,100);
l.setFont(new Font("serif",Font.PLAIN,70));
l.setForeground(Color.WHITE);
id.add(l);
id.add(bu);
fro.add(id);
fro.getContentPane().setBackground(Color.black);
fro.setVisible(true);
fro.setSize(1360,750);
fro.setLocation(200,100);
//This piece of code is used to give a dipper effect to label l
while(true){
l.setVisible(false);
try{
Thread.sleep(500);
}
catch (Exception e ){}
l.setVisible(true);
try{
Thread.sleep(500);
}
catch(Exception e){}
}
}
public void actionPerformed(ActionEvent log){
if(log.getSource()==bu){
fro.setVisible(false);
new Login();
}
}
public static void main(String[] arg){
Front fro=new Front() {};
}
}