-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathFrmSplash.java
More file actions
87 lines (83 loc) · 2.15 KB
/
FrmSplash.java
File metadata and controls
87 lines (83 loc) · 2.15 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
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
package hms;
import javax.swing.JFrame;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.SwingConstants;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Font;
import java.sql.*;
public class FrmSplash extends JFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
private int duration=3000;
private JLabel label1,label2,label3;
private JPanel panel;
ImageIcon pic1,pic2;
Font font;
public FrmSplash()
{
super("SPLASH SCREEN");
getContentPane().setBackground(Color.WHITE);
setLayout(new BorderLayout());
panel=new JPanel(new GridLayout(2,1));
panel.setBackground(Color.white);
pic1=new ImageIcon("images/splashscreen_pic2.jpg");
label1=new JLabel(pic1);
label1.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(label1);
pic2 =new ImageIcon("images/hourglass.gif");
label2=new JLabel(pic2,JLabel.CENTER);
font=new Font("Serif",Font.BOLD,80);
label2.setText("Hospital Management System");
label2.setFont(font);
label2.setForeground(Color.red);
label2.setHorizontalTextPosition(SwingConstants.CENTER);
label2.setVerticalTextPosition(SwingConstants.TOP);
panel.add(label2);
add(panel,BorderLayout.CENTER);
label3=new JLabel();
font=new Font("Sans-Serif",Font.BOLD,20);
label3.setText(" COPYRIGHT "+(char)169+" 2016, Abhinav Gupta");
label3.setFont(font);
label3.setHorizontalTextPosition(SwingConstants.CENTER);
add(label3,BorderLayout.SOUTH);
setExtendedState(JFrame.MAXIMIZED_BOTH);
setUndecorated(true);
setVisible(true);
try
{
Thread.sleep(duration);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
CommonMethods.createAllTables();
dispose();
try
{
DConnection dc=new DConnection();
ResultSet rst=dc.executeQuery("select count(*) from users");
rst.next();
int cnt=rst.getInt(1);
dc.close();
if(cnt==0)
new FrmCreateUser();
else
new FrmLogin();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
public static void main (String[] args)
{
new FrmSplash();
}
}