-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplash.java
More file actions
54 lines (49 loc) · 1.57 KB
/
Copy pathSplash.java
File metadata and controls
54 lines (49 loc) · 1.57 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
52
53
54
package cryptography;
import javax.swing.*;
import java.awt.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Splash extends JFrame {
private JLabel imglabel;
private ImageIcon img;
private static JProgressBar pbar;
Thread t = null;
public Splash() {
super("PUBLIC KEY CRYPTOGRAPHY -- by Aishwarya, Ria and Nilesh");
setSize(650, 510);
setBackground(Color.blue);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setLocationRelativeTo(null);
// setUndecorated(true);
img = new ImageIcon(getClass().getResource("bg.jpg"));
imglabel = new JLabel(img);
add(imglabel);
setLayout(null);
pbar = new JProgressBar();
pbar.setMinimum(0);
pbar.setMaximum(100);
pbar.setStringPainted(true);
pbar.setForeground(Color.RED);
pbar.setBackground(Color.darkGray);
imglabel.setBounds(0, 0, 626, 399);
add(pbar);
pbar.setPreferredSize(new Dimension(410, 30));
pbar.setBounds(0, 390, 626, 20);
Thread t = new Thread() {
@Override
public void run() {
int i = 0;
while (i <= 100) {
pbar.setValue(i);
try {
sleep(90);
} catch (InterruptedException ex) {
Logger.getLogger(Splash.class.getName()).log(Level.SEVERE, null, ex);
}
i++;
}
}
};
t.start();
}
}