-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistration.java
More file actions
476 lines (420 loc) · 25.8 KB
/
Registration.java
File metadata and controls
476 lines (420 loc) · 25.8 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.Timer;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Ruvinya
*/
public class Registration extends javax.swing.JFrame {
Connection con = null;
PreparedStatement pst = null;
/**
* Creates new form Registration
*/
public Registration() {
initComponents();
setSize(1079,730);
setLocation(570,230);
setResizable(false);
showDate();
showTime();
Toolkit toolkit = getToolkit();
Dimension size = toolkit.getScreenSize();
setLocation(size.width/2 - getWidth()/2,
size.height/2 - getHeight()/2);
}
void showDate() {
Date d = new Date();
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
jLabelDate.setText(s.format(d));
}
void showTime() {
new Timer(0, new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
Date d = new Date();
SimpleDateFormat s = new SimpleDateFormat("hh:mm:ss");
jLabelTime.setText(s.format(d));
}
}).start();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jDesktopPane1 = new javax.swing.JDesktopPane();
jPanel1 = new javax.swing.JPanel();
jLabelStudentID = new javax.swing.JLabel();
jLabelFirstName = new javax.swing.JLabel();
jLabelLastName = new javax.swing.JLabel();
jLabelUsername = new javax.swing.JLabel();
jLabelPassword = new javax.swing.JLabel();
jLabelConfirmPassword = new javax.swing.JLabel();
jLabelEmailAddress = new javax.swing.JLabel();
jTextFieldStudentID = new javax.swing.JTextField();
jTextFieldFirstName = new javax.swing.JTextField();
jTextFieldLastName = new javax.swing.JTextField();
jTextFieldUsername = new javax.swing.JTextField();
jTextFieldEmailAddress = new javax.swing.JTextField();
jButtonRegister = new javax.swing.JButton();
jButtonClear = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabelClickLogin = new javax.swing.JLabel();
jPasswordField = new javax.swing.JPasswordField();
jPasswordFieldConfirmPassword = new javax.swing.JPasswordField();
jLabelDate = new javax.swing.JLabel();
jLabelTime = new javax.swing.JLabel();
jLabelRegistration = new javax.swing.JLabel();
jLabelClose = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
jPanel1.setBackground(new java.awt.Color(0, 153, 255));
jLabelStudentID.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelStudentID.setForeground(new java.awt.Color(49, 47, 76));
jLabelStudentID.setText("National ID");
jLabelFirstName.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelFirstName.setForeground(new java.awt.Color(49, 47, 76));
jLabelFirstName.setText("First Name");
jLabelLastName.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelLastName.setForeground(new java.awt.Color(49, 47, 76));
jLabelLastName.setText("Last Name");
jLabelUsername.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelUsername.setForeground(new java.awt.Color(49, 47, 76));
jLabelUsername.setText("Username");
jLabelPassword.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelPassword.setForeground(new java.awt.Color(49, 47, 76));
jLabelPassword.setText("Password");
jLabelConfirmPassword.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelConfirmPassword.setForeground(new java.awt.Color(49, 47, 76));
jLabelConfirmPassword.setText("Confirm Password");
jLabelEmailAddress.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jLabelEmailAddress.setForeground(new java.awt.Color(49, 47, 76));
jLabelEmailAddress.setText("Email Address");
jTextFieldStudentID.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jTextFieldStudentID.setForeground(new java.awt.Color(102, 102, 102));
jTextFieldFirstName.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jTextFieldFirstName.setForeground(new java.awt.Color(102, 102, 102));
jTextFieldLastName.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jTextFieldLastName.setForeground(new java.awt.Color(102, 102, 102));
jTextFieldUsername.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jTextFieldUsername.setForeground(new java.awt.Color(102, 102, 102));
jTextFieldEmailAddress.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jTextFieldEmailAddress.setForeground(new java.awt.Color(102, 102, 102));
jButtonRegister.setBackground(new java.awt.Color(49, 47, 76));
jButtonRegister.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jButtonRegister.setForeground(new java.awt.Color(255, 255, 255));
jButtonRegister.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/icons8-registration-40.png"))); // NOI18N
jButtonRegister.setText("Register");
jButtonRegister.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonRegisterActionPerformed(evt);
}
});
jButtonClear.setBackground(new java.awt.Color(209, 117, 89));
jButtonClear.setFont(new java.awt.Font("Dubai", 0, 20)); // NOI18N
jButtonClear.setForeground(new java.awt.Color(255, 255, 255));
jButtonClear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/icons8-erase-40.png"))); // NOI18N
jButtonClear.setText("Clear");
jButtonClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearActionPerformed(evt);
}
});
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/register.png"))); // NOI18N
jLabel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Register "));
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Register.gif"))); // NOI18N
jLabel3.setText("jLabel3");
jLabel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jLabelClickLogin.setFont(new java.awt.Font("Dubai", 1, 22)); // NOI18N
jLabelClickLogin.setForeground(new java.awt.Color(255, 102, 102));
jLabelClickLogin.setText("Click here to login");
jLabelClickLogin.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabelClickLoginMouseClicked(evt);
}
});
jPasswordField.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jPasswordField.setForeground(new java.awt.Color(102, 102, 102));
jPasswordFieldConfirmPassword.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
jPasswordFieldConfirmPassword.setForeground(new java.awt.Color(102, 102, 102));
jLabelDate.setFont(new java.awt.Font("Dubai", 1, 18)); // NOI18N
jLabelDate.setForeground(new java.awt.Color(0, 204, 102));
jLabelDate.setText("Date");
jLabelTime.setFont(new java.awt.Font("Dubai", 1, 18)); // NOI18N
jLabelTime.setForeground(new java.awt.Color(0, 204, 102));
jLabelTime.setText("Time");
jLabelRegistration.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 48)); // NOI18N
jLabelRegistration.setText("REGISTRATION");
jLabelClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/icons8-close-window-40.png"))); // NOI18N
jLabelClose.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabelCloseMouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabelPassword)
.addComponent(jLabelConfirmPassword)
.addComponent(jLabelEmailAddress))
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPasswordFieldConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButtonRegister)
.addGap(41, 41, 41)
.addComponent(jButtonClear, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jTextFieldEmailAddress, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)
.addComponent(jTextFieldStudentID, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextFieldFirstName, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextFieldLastName, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextFieldUsername, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPasswordField, javax.swing.GroupLayout.Alignment.LEADING))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(42, 42, 42)
.addComponent(jLabelRegistration)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 173, Short.MAX_VALUE)
.addComponent(jLabelClose)
.addGap(15, 15, 15))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addGap(53, 53, 53)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabelDate)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabelClickLogin)
.addGap(106, 106, 106)
.addComponent(jLabelTime)
.addGap(149, 149, 149))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabelStudentID)
.addComponent(jLabelFirstName)
.addComponent(jLabelLastName)
.addComponent(jLabelUsername))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(15, 15, 15)
.addComponent(jLabelClose))
.addComponent(jLabelRegistration))
.addGap(60, 60, 60)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelStudentID)
.addComponent(jPasswordFieldConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelFirstName)
.addComponent(jPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(44, 44, 44)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelLastName)
.addComponent(jTextFieldUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(40, 40, 40)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelUsername)
.addComponent(jTextFieldLastName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(17, 17, 17)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelClickLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabelTime))
.addGap(179, 179, 179))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelPassword)
.addComponent(jTextFieldFirstName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelConfirmPassword)
.addComponent(jTextFieldStudentID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(46, 46, 46)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelEmailAddress)
.addComponent(jTextFieldEmailAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(271, 271, 271)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonClear)
.addComponent(jButtonRegister))
.addGap(18, 18, 18)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
.addComponent(jLabelDate)
.addGap(159, 159, 159))))
);
jDesktopPane1.setLayer(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
jDesktopPane1.setLayout(jDesktopPane1Layout);
jDesktopPane1Layout.setHorizontalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane1Layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 12, Short.MAX_VALUE))
);
jDesktopPane1Layout.setVerticalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDesktopPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButtonRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRegisterActionPerformed
String a = jTextFieldStudentID.getText();
String b = jTextFieldFirstName.getText() ;
String c = jTextFieldLastName.getText() ;
String d = jTextFieldUsername.getText() ;
String e = jPasswordField.getText();
String f =jPasswordFieldConfirmPassword.getText() ;
String g = jTextFieldEmailAddress.getText() ;
try{
String query = "INSERT INTO register ( studentID , firstName , lastName , username , password , confirmPassword ,emailAddress ) VALUES ('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"')";
con = database.connect();
pst = con.prepareStatement(query);
pst.execute();
JOptionPane.showMessageDialog(null, "Register Successfully");
}catch(Exception ex){
JOptionPane.showMessageDialog(null,ex);
}
}//GEN-LAST:event_jButtonRegisterActionPerformed
private JFrame frame;
private void jLabelClickLoginMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelClickLoginMouseClicked
new Login().setVisible(true);
}//GEN-LAST:event_jLabelClickLoginMouseClicked
private void jButtonClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearActionPerformed
jTextFieldStudentID.setText(null);
jTextFieldFirstName.setText(null);
jTextFieldLastName.setText(null);
jTextFieldUsername.setText(null);
jPasswordField.setText(null);
jPasswordFieldConfirmPassword.setText(null);
jTextFieldEmailAddress.setText(null);
}//GEN-LAST:event_jButtonClearActionPerformed
private void jLabelCloseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCloseMouseClicked
System.exit(0);
}//GEN-LAST:event_jLabelCloseMouseClicked
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Registration().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonClear;
private javax.swing.JButton jButtonRegister;
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabelClickLogin;
private javax.swing.JLabel jLabelClose;
private javax.swing.JLabel jLabelConfirmPassword;
private javax.swing.JLabel jLabelDate;
private javax.swing.JLabel jLabelEmailAddress;
private javax.swing.JLabel jLabelFirstName;
private javax.swing.JLabel jLabelLastName;
private javax.swing.JLabel jLabelPassword;
private javax.swing.JLabel jLabelRegistration;
private javax.swing.JLabel jLabelStudentID;
private javax.swing.JLabel jLabelTime;
private javax.swing.JLabel jLabelUsername;
private javax.swing.JPanel jPanel1;
private javax.swing.JPasswordField jPasswordField;
private javax.swing.JPasswordField jPasswordFieldConfirmPassword;
private javax.swing.JTextField jTextFieldEmailAddress;
private javax.swing.JTextField jTextFieldFirstName;
private javax.swing.JTextField jTextFieldLastName;
private javax.swing.JTextField jTextFieldStudentID;
private javax.swing.JTextField jTextFieldUsername;
// End of variables declaration//GEN-END:variables
}