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