-
Notifications
You must be signed in to change notification settings - Fork 0
/
Loading.java
78 lines (65 loc) · 2.52 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
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;
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 Home().setVisible(true);
}
Thread.sleep(50);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public Loading() {
super("Loading");
th = new Thread((Runnable) this);
setBounds(600, 300, 600, 400);
contentPane = new JPanel();
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lbllibraryManagement = new JLabel("Welcome To Our Smart Library v5.1!!!!");
lbllibraryManagement.setForeground(new Color(72, 209, 204));
lbllibraryManagement.setFont(new Font("Serif", Font.ITALIC, 25));
lbllibraryManagement.setBounds(130, 46, 500, 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);
JPanel panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setBounds(0, 0, 590, 390);
contentPane.add(panel);
setUploading();
}
}