-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoading.java
102 lines (67 loc) · 2.37 KB
/
Loading.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package student.management.system;
import java.awt.Color;
import java.awt.Font;
import javax.swing.*;
import java.awt.event.*;
public class Loading extends JFrame implements Runnable {
JProgressBar p;
Thread t;
public void run(){
try{
for(int i=1;i<=101;i++){
int m=p.getMaximum();
int n=p.getValue();
if(n<m){
p.setValue(p.getValue()+1);
// if(n<=m){
// this.setVisible(false);
// new Student_Details().setVisible(true);
// }
}else{
i=101;
this.setVisible(false);
new Student_Details().setVisible(true);
}
Thread.sleep(50);
}
}catch(Exception e){}
}
Loading(String user){
super("Loading");
String Username=user;
t=new Thread(this);
setVisible(true);
setBounds(650,250,800,500);
getContentPane().setBackground(Color.WHITE);
setResizable(false);
setLayout(null);
ImageIcon i=new ImageIcon(ClassLoader.getSystemResource("student/management/system/Icons/Logo.png"));
this.setIconImage(i.getImage());
JLabel l=new JLabel("Student Management System");
l.setBounds(140,20,600,40);
l.setFont(new Font("Raleway",Font.BOLD,35));
l.setForeground(Color.BLUE);
add(l);
p=new JProgressBar();
p.setStringPainted(true);
p.setBounds(210,100,350,25);
add(p);
JLabel l1=new JLabel("Please Wait...");
l1.setBounds(310,140,150,20);
l1.setFont(new Font("Tahoma",Font.BOLD,18));
l1.setForeground(Color.RED);
add(l1);
JLabel l2=new JLabel("Welcome"+" "+Username);
l2.setBounds(20,420,150,20);
l2.setFont(new Font("Tahoma",Font.BOLD,18));
l2.setForeground(Color.RED);
add(l2);
t.start();
}
// public void actionPerformed(ActionEvent ae){
//
//}
public static void main(String[] args){
new Loading("").setVisible(true);
}
}