This repository was archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.java
More file actions
98 lines (84 loc) · 2.69 KB
/
Copy pathMainWindow.java
File metadata and controls
98 lines (84 loc) · 2.69 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
88
89
90
91
92
93
94
95
96
97
98
// package tec181;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MainWindow extends JFrame {
private JPanel contentPane;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainWindow frame = new MainWindow();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public MainWindow() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 850, 425);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Welcome to Department Event Portal");
lblNewLabel.setFont(new Font("Segoe UI Semibold", Font.BOLD, 35));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setBounds(111, 11, 609, 137);
contentPane.add(lblNewLabel);
JButton signUpButton = new JButton("New user?");
signUpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Registration frame = new Registration();
frame.setVisible(true);
dispose();
} catch (Exception e1) {
e1.printStackTrace();
}
}
});
signUpButton.setFont(new Font("Segoe UI Semibold", Font.PLAIN, 13));
signUpButton.setBounds(177, 256, 109, 33);
contentPane.add(signUpButton);
JButton loginButton = new JButton("Login");
loginButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Login frame = new Login();
frame.setVisible(true);
dispose();
} catch (Exception e1) {
e1.printStackTrace();
}
}
});
loginButton.setFont(new Font("Segoe UI Semibold", Font.PLAIN, 13));
loginButton.setBounds(361, 256, 109, 33);
contentPane.add(loginButton);
JButton adminLoginButton = new JButton("Admin Login");
adminLoginButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
AdminLogin frame = new AdminLogin();
frame.setVisible(true);
dispose();
} catch (Exception e1) {
e1.printStackTrace();
}
}
});
adminLoginButton.setFont(new Font("Segoe UI Semibold", Font.PLAIN, 13));
adminLoginButton.setBounds(548, 256, 123, 33);
contentPane.add(adminLoginButton);
}
}