Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b19f745

Browse files
Add files via upload
1 parent bec2765 commit b19f745

File tree

10 files changed

+1377
-0
lines changed

10 files changed

+1377
-0
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
package Stedium_Management;
2+
3+
4+
import java.awt.EventQueue;
5+
import java.awt.event.ActionEvent;
6+
import java.awt.event.ActionListener;
7+
import java.sql.DriverManager;
8+
import java.sql.*;
9+
import javax.swing.JFrame;
10+
import javax.swing.JPanel;
11+
import javax.swing.JRadioButton;
12+
import javax.swing.JTextArea;
13+
import javax.swing.JTextField;
14+
import javax.swing.border.EmptyBorder;
15+
16+
import com.mysql.cj.xdevapi.Statement;
17+
18+
import Hariom.Connection;
19+
20+
import javax.swing.JMenuBar;
21+
import javax.swing.JMenu;
22+
import javax.swing.JMenuItem;
23+
import javax.swing.JOptionPane;
24+
25+
import java.awt.Font;
26+
import java.awt.Toolkit;
27+
28+
import javax.swing.JButton;
29+
import javax.swing.JLabel;
30+
import javax.swing.ImageIcon;
31+
32+
public class Add_events extends JFrame {
33+
34+
private JPanel contentPane;
35+
private JTextField textPromo;
36+
37+
public static void main(String[] args) {
38+
EventQueue.invokeLater(new Runnable() {
39+
public void run() {
40+
try {
41+
Add_events frame = new Add_events();
42+
frame.setVisible(true);
43+
} catch (Exception e) {
44+
e.printStackTrace();
45+
}
46+
}
47+
});
48+
}
49+
50+
/**
51+
* Create the frame.
52+
*/
53+
public Add_events() {
54+
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\STDM.jpg"));
55+
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
56+
setBounds(458, 319, 1000, 460);
57+
setResizable(false);
58+
contentPane = new JPanel();
59+
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
60+
setContentPane(contentPane);
61+
contentPane.setLayout(null);
62+
63+
JLabel lblNewLabel = new JLabel("Date");
64+
lblNewLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20));
65+
lblNewLabel.setBounds(104, 79, 53, 29);
66+
contentPane.add(lblNewLabel);
67+
68+
JTextArea textArea = new JTextArea();
69+
///textArea.setText("DD-MM-YY");
70+
textArea.setFont(new Font("Segoe UI", Font.PLAIN, 20));
71+
textArea.setBounds(169, 78,166, 37);
72+
contentPane.add(textArea);
73+
74+
JLabel lblNewLabel_1 = new JLabel("Events");
75+
lblNewLabel_1.setFont(new Font("Segoe UI", Font.PLAIN, 20));
76+
lblNewLabel_1.setBounds(584, 76, 56, 34);
77+
contentPane.add(lblNewLabel_1);
78+
79+
80+
JLabel lblNewLabel_2 = new JLabel("(dd-mm-yy)");
81+
lblNewLabel_2.setBounds(93, 111, 68, 16);
82+
contentPane.add(lblNewLabel_2);
83+
84+
JTextArea textEvents = new JTextArea();
85+
textEvents.setFont(new Font("Segoe UI", Font.PLAIN, 20));
86+
textEvents.setBounds(657, 78,166, 37);
87+
contentPane.add(textEvents);
88+
89+
JLabel lblSeats = new JLabel("Seats");
90+
lblSeats.setFont(new Font("Segoe UI", Font.PLAIN, 20));
91+
lblSeats.setBounds(104, 196, 56, 36);
92+
contentPane.add(lblSeats);
93+
94+
JTextArea textSeats = new JTextArea();
95+
textSeats.setFont(new Font("Segoe UI", Font.PLAIN, 20));
96+
textSeats.setBounds(169, 196, 166, 37);
97+
contentPane.add(textSeats);
98+
99+
JTextArea textTime = new JTextArea();
100+
textTime.setFont(new Font("Segoe UI", Font.PLAIN, 20));
101+
textTime.setBounds(657, 199, 166, 37);
102+
contentPane.add(textTime);
103+
104+
JLabel lblTime = new JLabel("Time");
105+
lblTime.setFont(new Font("Segoe UI", Font.PLAIN, 20));
106+
lblTime.setBounds(584, 200, 56, 29);
107+
contentPane.add(lblTime);
108+
109+
JRadioButton rdbtnAddPromo = new JRadioButton("Add promo");
110+
rdbtnAddPromo.addActionListener(new ActionListener() {
111+
public void actionPerformed(ActionEvent e) {
112+
if(rdbtnAddPromo.isSelected())
113+
{
114+
textPromo.setEnabled(true);
115+
}
116+
else
117+
{
118+
textPromo.setEnabled(false);
119+
}
120+
121+
}
122+
});
123+
rdbtnAddPromo.setBounds(412, 226, 127, 25);
124+
contentPane.add(rdbtnAddPromo);
125+
126+
textPromo = new JTextField();
127+
textPromo.setEnabled(false);
128+
textPromo.setBounds(412, 254, 116, 29);
129+
//textField.setEnabled(false);
130+
contentPane.add(textPromo);
131+
textPromo.setColumns(10);
132+
133+
JButton btnNewButton = new JButton("Add\r\n\r\n");
134+
btnNewButton.addActionListener(new ActionListener() {
135+
public void actionPerformed(ActionEvent e) {
136+
int a=JOptionPane.showConfirmDialog(btnNewButton,"Are you sure?");
137+
//JOptionPane.setRootFrame(null);
138+
if(a==JOptionPane.YES_OPTION){
139+
String date=textArea.getText();
140+
String seats=textSeats.getText();
141+
String time=textTime.getText();
142+
String event=textEvents.getText();
143+
if(rdbtnAddPromo.isSelected())
144+
{
145+
String promo=textPromo.getText();
146+
}
147+
148+
/* try{
149+
Class.forName("oracle.jdbc.driver.OracleDriver");
150+
Connection con=(Connection) DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","soumya","1234");
151+
String query="select date yo event ";
152+
Statement st=con.createStatement();
153+
int x=st.executeUpdate(query);
154+
155+
con.close();
156+
}
157+
catch(Exception f)
158+
{
159+
System.out.println(f);
160+
}
161+
JOptionPane.showMessageDialog(btnNewButton, "Event is successfully added");
162+
//System.exit(0);*/
163+
}
164+
}
165+
});
166+
btnNewButton.setFont(new Font("Segoe UI", Font.PLAIN, 27));
167+
btnNewButton.setBounds(412, 309, 127, 61);
168+
contentPane.add(btnNewButton);
169+
}
170+
}
171+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
package Stedium_Management;
2+
3+
import javax.swing.*;
4+
import java.awt.BorderLayout;
5+
import java.awt.EventQueue;
6+
import java.awt.Font;
7+
import java.awt.Toolkit;
8+
9+
import javax.swing.border.EmptyBorder;
10+
11+
import java.awt.event.ActionListener;
12+
import java.awt.event.ActionEvent;
13+
import java.awt.Color;
14+
15+
public class AdminLogin extends JFrame {
16+
17+
private JPanel contentPane;
18+
private JTextField textField;
19+
private JPasswordField passwordField;
20+
private JButton btnNewButton;
21+
private JButton btnNewButton_1;
22+
private String user[]={"Soumyadip","Soumya"};
23+
private String pass[]={"abcd","abcde"};
24+
private JLabel lblNewLabel_1;
25+
private JLabel label;
26+
/**
27+
* Launch the application.
28+
*/
29+
public static void main(String[] args) {
30+
EventQueue.invokeLater(new Runnable() {
31+
public void run() {
32+
try {
33+
AdminLogin frame = new AdminLogin();
34+
frame.setTitle("Stedium Management System");
35+
frame.setVisible(true);
36+
} catch (Exception e) {
37+
e.printStackTrace();
38+
}
39+
}
40+
});
41+
}
42+
43+
/**
44+
* Create the frame.
45+
*/
46+
public AdminLogin() {
47+
48+
49+
50+
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Soumyadeep\\Desktop\\STDM.jpg"));
51+
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
52+
setBounds(450, 190, 1014, 597);
53+
setResizable(false);
54+
contentPane = new JPanel();
55+
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
56+
setContentPane(contentPane);
57+
contentPane.setLayout(null);
58+
59+
JLabel lblNewLabel = new JLabel("Admin Login");
60+
lblNewLabel.setFont(new Font("Times New Roman", Font.PLAIN, 46));
61+
lblNewLabel.setBounds(364, 60, 273, 93);
62+
contentPane.add(lblNewLabel);
63+
64+
textField = new JTextField();
65+
textField.setFont(new Font("Tahoma", Font.PLAIN, 32));
66+
textField.setBounds(481, 170, 281, 68);
67+
contentPane.add(textField);
68+
textField.setColumns(10);
69+
70+
passwordField = new JPasswordField();
71+
passwordField.setFont(new Font("Tahoma", Font.PLAIN, 32));
72+
passwordField.setBounds(481, 286, 281, 68);
73+
contentPane.add(passwordField);
74+
75+
JLabel lblUsername = new JLabel("Username");
76+
lblUsername.setFont(new Font("Tahoma", Font.PLAIN, 31));
77+
lblUsername.setBounds(250, 166, 193, 52);
78+
contentPane.add(lblUsername);
79+
80+
JLabel lblPassword = new JLabel("Password");
81+
lblPassword.setBackground(Color.CYAN);
82+
lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 31));
83+
lblPassword.setBounds(250, 286, 193, 52);
84+
contentPane.add(lblPassword);
85+
86+
btnNewButton = new JButton("Login");
87+
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 26));
88+
btnNewButton.setBounds(545, 392, 162, 73);
89+
btnNewButton.addActionListener(new ActionListener() {
90+
91+
public void actionPerformed(ActionEvent e) {
92+
// TODO Auto-generated method stub
93+
int i=0,j=0;
94+
String ustr=textField.getText();
95+
String pstr=passwordField.getText();
96+
97+
98+
if( ustr.equals("Soumya") && pstr.equals("1234"))
99+
{
100+
dispose();
101+
Admin_host ah=new Admin_host();
102+
ah.setTitle("Stadium Management System");
103+
ah.setVisible(true);
104+
JOptionPane.showMessageDialog(btnNewButton, "You have successfully logged in");
105+
}
106+
else
107+
{
108+
JOptionPane.showMessageDialog(btnNewButton, "Wrong Username & Password");
109+
}
110+
}
111+
});
112+
113+
contentPane.add(btnNewButton);
114+
115+
btnNewButton_1 = new JButton("User Login");
116+
btnNewButton_1.addActionListener(new ActionListener() {
117+
public void actionPerformed(ActionEvent e) {
118+
dispose();
119+
Userlogin us=new Userlogin();
120+
us.setTitle("Stadium Management System");
121+
us.setVisible(true);
122+
}
123+
});
124+
btnNewButton_1.setFont(new Font("Tahoma", Font.PLAIN, 26));
125+
btnNewButton_1.setBounds(250, 387, 193, 83);
126+
contentPane.add(btnNewButton_1);
127+
128+
129+
130+
}
131+
132+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /