-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplash.java
More file actions
49 lines (42 loc) · 1.12 KB
/
Splash.java
File metadata and controls
49 lines (42 loc) · 1.12 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
package electricity.billing.system;
import javax.swing.*;
import java.awt.*;
public class Splash extends JFrame implements Runnable{
Thread t;
Splash(){
ImageIcon i1= new ImageIcon(ClassLoader.getSystemResource("icon/elect.jpg"));
Image i2= i1.getImage().getScaledInstance(730, 550, Image.SCALE_DEFAULT);
ImageIcon i3= new ImageIcon(i2);
JLabel image= new JLabel(i3);
add(image);
setVisible(true);
int x=1;
for (int i = 2; i < 600; i+=4, x+=1){
setSize(i + x, i);
setLocation(700 - ((i + x) / 2), 400 - (i / 2));
try{
Thread.sleep(5);
}
catch(Exception e){
e.printStackTrace();
}
}
t= new Thread(this); // 'this' is current class refrence
t.start();
setVisible(true);
}
public void run(){
try{
Thread.sleep(3000);
setVisible(false);
//login frame
new Login();
}
catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args){
new Splash();
}
}