-
Notifications
You must be signed in to change notification settings - Fork 5
/
Loading.java
97 lines (80 loc) · 3.22 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
package travel_and_Tourism_Organisation_System;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class Loading extends JFrame implements Runnable {
private JPanel contentPane;
private JProgressBar progressBar;
Connection conn;
String username;
int s;
Thread th;
public static void main(String[] args) {
new Loading("").setVisible(true);
}
public void setUploading() {
setVisible(false);
th.start();
}
public void run() {
try {
for (int i = 0; i < 200; i++) {
s = s + 1;
int m = progressBar.getMaximum();
int v = progressBar.getValue();
if (v < m) {
progressBar.setValue(progressBar.getValue() + 1);
} else {
i = 201;
setVisible(false);
new background().setVisible(false);
new Dashboard(username).setVisible(true);
}
Thread.sleep(50);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public Loading(String username) {
this.username = username;
th = new Thread((Runnable) this);
setBounds(340,200, 650, 400);
contentPane = new JPanel();
contentPane.setBackground(new Color(51,204, 255));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lbllibraryManagement = new JLabel("Travel and Toursim Application");
lbllibraryManagement.setForeground(new Color(72, 209, 204));
lbllibraryManagement.setFont(new Font("Trebuchet MS", Font.BOLD, 35));
lbllibraryManagement.setBounds(50, 46, 700, 35);
contentPane.add(lbllibraryManagement);
progressBar = new JProgressBar();
progressBar.setFont(new Font("Tahoma", Font.BOLD, 12));
progressBar.setStringPainted(true);
progressBar.setBounds(130, 135, 300, 25);
contentPane.add(progressBar);
JLabel lblNewLabel_2 = new JLabel("Please Wait....");
lblNewLabel_2.setFont(new Font("Yu Gothic UI Semibold", Font.BOLD, 20));
lblNewLabel_2.setForeground(new Color(160, 82, 45));
lblNewLabel_2.setBounds(200, 165, 150, 20);
contentPane.add(lblNewLabel_2);
JLabel user = new JLabel("Welcome! " + username +"...");
user.setBounds(20,310,400,40);
user.setForeground(Color.RED);
user.setFont(new Font("Raleway",Font.BOLD,16));
contentPane.add(user);
JPanel panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setBounds(10, 10,630, 380);
contentPane.add(panel);
setUndecorated(true);
setUploading();
}
}