-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoading.java
81 lines (58 loc) · 1.92 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
package TravelingSystem;
import java.awt.*;
import javax.swing.*;
public class Loading extends JFrame implements Runnable {
Thread t;
JProgressBar bar;
String username;
public void run(){
try{
for(int i=1;i<=101;i++){
int max=bar.getMaximum();
int value=bar.getValue();
if(value<max){
bar.setValue(bar.getValue() + 1);
}else{
setVisible(false);
new Dashboard(username);
}
Thread.sleep(50);
}
}catch(Exception e){
e.printStackTrace();
}
}
Loading(){
//this.username=username;
t=new Thread(this);
setBounds(500,200,650,400);
getContentPane().setBackground(Color.WHITE);
setLayout(null);
JLabel text=new JLabel("Travel and Tourism Application");
text.setBounds(50,20,600,40);
text.setForeground(Color.BLUE);
text.setFont(new Font("Tahoma", Font.BOLD,35));
add(text);
bar=new JProgressBar();
bar.setBounds(150,100,300,35);
bar.setStringPainted(true);
add(bar);
JLabel loading=new JLabel("Loading Please Wait...... ");
loading.setBounds(150,140,400,30);
loading.setForeground(Color.GREEN);
loading.setFont(new Font("Tahoma", Font.BOLD,15));
add(loading);
JLabel username=new JLabel("Welcome Anshu ");
username.setBounds(20,300,400,40);
username.setForeground(Color.GRAY);
username.setFont(new Font("Tahoma", Font.BOLD,35));
add(username);
t.start();
setVisible(true);
}
public static void main(String[] args){
new Loading();
}
}
{
}