-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplash.java
More file actions
48 lines (43 loc) · 1.24 KB
/
Splash.java
File metadata and controls
48 lines (43 loc) · 1.24 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
package travel.management.system;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Splash {
public static void main(String[] args){
SplashFrame f1 = new SplashFrame();
f1.setVisible(true);
int i;
int x=1;
for(i=2; i<=600; i+=10, x+=7){
f1.setLocation(900 - ((i+x)/2), 500 - (i/2));
f1.setSize(i+x,i);
try{
Thread.sleep(10);
}catch(Exception e){}
}
}
}
class SplashFrame extends JFrame implements Runnable{
Thread t1;
SplashFrame(){
setLayout(new FlowLayout());
ImageIcon c1 = new ImageIcon(ClassLoader.getSystemResource("icons/splash.jpg"));
Image i1 = c1.getImage().getScaledInstance(1030, 750,Image.SCALE_DEFAULT);
ImageIcon i2 = new ImageIcon(i1);
JLabel l1 = new JLabel(i2);
add(l1);
setUndecorated(true);
t1 = new Thread(this);
t1.start();
}
public void run(){
try{
Thread.sleep(7000);
this.setVisible(false);
Login l = new Login();
l.setVisible(true);
}catch(Exception e){
e.printStackTrace();
}
}
}