-
Notifications
You must be signed in to change notification settings - Fork 3
/
Splash.java
56 lines (44 loc) · 1.42 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
// follow on projected completed on 5/4/2024
// time 4.33 pm
// day friday
// channel codeforinterview
package university.management.system;
import javax.swing.*;
import java.awt.*;
public class Splash extends JFrame implements Runnable {
Thread t;
Splash () {
// ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons1/uni back 3.jpg"));
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/first.jpg"));
Image i2 = i1.getImage().getScaledInstance(1000, 700, Image.SCALE_SMOOTH);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
add(image);
t = new Thread(this);
t.start();
setVisible(true);
int x = 1;
for (int i = 2; i <= 600; i+=4, x+=1) {
setLocation(600 - ((i + x)/2), 350 - (i/2));
setSize(i + 3*x, i + x/2);
try {
Thread.sleep(10);
} catch (Exception e) {
System.out.println("error at line 30");
}
}
}
public void run() {
try {
Thread.sleep(7000);
setVisible(false);
// Next Frame
new Login();
} catch (Exception e) {
System.out.println("error at line 43 check source code!");
}
}
public static void main(String[] args) {
new Splash(); // <-anonymous object!(constructor will be called!)
}
}