-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplash.java
More file actions
52 lines (41 loc) · 1.13 KB
/
Copy pathSplash.java
File metadata and controls
52 lines (41 loc) · 1.13 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
package campusComplaints;
import javax.swing.*;
import java.awt.*;
public class Splash extends JFrame implements Runnable {
ImageIcon i1 = new ImageIcon(Splash.class.getResource("splash.jpeg"));
Image i2 = i1.getImage().getScaledInstance(900,600,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
Splash() {
this.setLayout(null);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
add(image);
image.setSize(900,600);
Thread t1 = new Thread(this);
t1.start();
}
public void run()
{
try {
Thread.sleep(7000);
} catch (InterruptedException e) {
}
this.setVisible(false);
new Login();
}
public static void main(String[] args) {
Splash s = new Splash();
for(int i =0 ; i<=450 ; i++)
{
s.setSize(2*i,2*i-200);
s.setLocation(750-(i-150),400-(i/2));
try {
Thread.sleep(4);
}
catch(Exception e)
{
}
}
}
}