-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplash.java
More file actions
66 lines (57 loc) · 2.22 KB
/
Splash.java
File metadata and controls
66 lines (57 loc) · 2.22 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
package employee.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Splash extends JFrame implements ActionListener{
//Constructor of Splash class
public Splash(){
getContentPane().setBackground(Color.WHITE);//bg color specified white
setLayout(null);
JLabel heading=new JLabel("EMPLOYEE MANAGEMENT SYSTEM");
heading.setBounds(200, 30, 1200, 60); //bound of text
Font myfont=new Font("serif", Font.BOLD, 45);//object of Font
heading.setFont(myfont); //passing obj as paramenter
heading.setForeground(Color.BLACK);
add(heading); //add heading to JFrame
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/Office-Management-System.png"));
Image i2 = i1.getImage().getScaledInstance(1100, 700, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(70, 100, 1050, 500);
add(image);
JButton clickhere = new JButton("CLICK HERE TO CONTINUE");
clickhere.setBounds(400, 400, 300, 70);
clickhere.setBackground(Color.BLACK);
clickhere.setForeground(Color.WHITE);
clickhere.addActionListener(this);
// clickhere.addActionListener(this);
image.add(clickhere);
setSize(1200, 700); //size of jframe
setLocation(200,50);//location wrt to desktop
setDefaultCloseOperation(EXIT_ON_CLOSE); //on exiting window, build stops
setVisible(true); //visible or not?
while(true){
heading.setVisible(false);
try{
Thread.sleep(300);
}
catch(InterruptedException e){
}
heading.setVisible(true);
try{
Thread.sleep(500);
}
catch(InterruptedException e){
}
}
}
@Override
public void actionPerformed(ActionEvent e){
setVisible(false);
new Login();
}
//main method
public static void main(String args[]){
new Splash();
}
}