-
Notifications
You must be signed in to change notification settings - Fork 5
/
Splash.java
58 lines (46 loc) · 1.16 KB
/
Splash.java
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
package travel_and_Tourism_Organisation_System;
import java.awt.Image;
import javax.swing.*;
public class Splash {
public static void main(String[] args) {
SplashFrame frame = new SplashFrame();
//setBounds(150,10,1000,50);
frame.setVisible(true);
int x=1;
for(int i=1;i<=500;i+=6,x+=7)
{
frame.setLocation(600 - (x+i)/2,250- (i/4));
frame.setSize(x+i,i);
try {
Thread.sleep(10);
}
catch(Exception e) {
}
}
frame.setVisible(true);
}
}
class SplashFrame extends JFrame implements Runnable {
Thread t1;
//JFrame f= new JFrame();
public SplashFrame(){
ImageIcon i1= new ImageIcon(ClassLoader.getSystemResource("travel_and_Tourism_Organisation_System/icons/splash.jpg"));
Image i2 = i1.getImage().getScaledInstance(1200, 500, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel l1=new JLabel(i3);
add(l1);
// setBounds(150,10,1000,650);
setUndecorated(true);
t1=new Thread(this);
t1.start();
}
public void run() {
try {
Thread.sleep(1000);
this.setVisible(false);
new Login().setVisible(true);
}
catch(Exception e) {
}
}
}