Repository navigation
Expand file tree
/
Copy pathWelcomeWindow.java
More file actions
57 lines (50 loc) · 1.57 KB
/
Copy pathWelcomeWindow.java
File metadata and controls
57 lines (50 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
55
56
57
package hospital_management_system;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class WelcomeWindow extends JFrame {
private JLabel label1;
public static int secondsPassed = 5;
WelcomeWindow() {
super("Hospital Management System");
setBounds(165, 130, 1000, 550);
getContentPane().setBackground(new Color(93, 138, 168));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);
setLocationRelativeTo(null);
setLayout(null);
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/IMAGES/welcome1.jpeg"));
label1 = new JLabel(imageIcon);
label1.setBounds(0, 0, 1000, 500);
add(label1);
setVisible(true);
}
public static void main(String[] args) {
WelcomeWindow obj = new WelcomeWindow();
}
@Override
public void paint(Graphics g) {
super.paint(g);
String time = " ";
if (secondsPassed > 0) {
g.drawString(time, 820, 350);
}
if (secondsPassed == 0) {
setVisible(false);
new StatusTypeWindow().setVisible(true);
}
secondsPassed--;
try {
Thread.sleep(1000);
repaint();
} catch (Exception e) {
}
}
}