Repository navigation
Expand file tree
/
Copy pathLandingPage.java
More file actions
787 lines (710 loc) · 35.9 KB
/
Copy pathLandingPage.java
File metadata and controls
787 lines (710 loc) · 35.9 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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package supreme.rentals;
import java.awt.*;
import javax.swing.*;
import java.awt.Color;
import java.sql.*;
import javax.swing.JOptionPane;
/**
*
* @author Jesuye
*/
public class LandingPage extends javax.swing.JFrame {
/**
* Creates new form LandingPage
*/
Connection conn=null;
ResultSet rs=null;
PreparedStatement pst=null;
public LandingPage() {
initComponents();
getContentPane().setBackground(Color.WHITE);
getContentPane().setBounds(150, 150, 150, 150);
conn=javaconnect.ConnecrDb();
jTextField4.setVisible(false);
jButton8.setVisible(false);
jTextField5.setVisible(false);
jButton9.setVisible(false);
jTextField6.setVisible(false);
jButton10.setVisible(false);
jTextField7.setVisible(false);
jButton11.setVisible(false);
}
/**
* 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() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
resNoText = new javax.swing.JTextField();
staffIDInfoText = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jTextField4 = new javax.swing.JTextField();
jButton9 = new javax.swing.JButton();
jTextField5 = new javax.swing.JTextField();
jButton10 = new javax.swing.JButton();
jTextField6 = new javax.swing.JTextField();
jButton11 = new javax.swing.JButton();
jTextField7 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setBackground(new java.awt.Color(255, 255, 255));
addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
formMouseClicked(evt);
}
});
jLabel1.setBackground(new java.awt.Color(255, 255, 255));
jLabel1.setFont(new java.awt.Font("Segoe Print", 1, 24)); // NOI18N
jLabel1.setText("SUPREME CAR RENTALS");
jLabel2.setText("Res. No.");
jLabel3.setText("StaffID");
resNoText.setBackground(new java.awt.Color(0, 0, 0));
resNoText.setForeground(new java.awt.Color(255, 255, 255));
resNoText.setText(" Enter Reservation number");
resNoText.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
resNoText.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
resNoTextMouseClicked(evt);
}
});
resNoText.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
resNoTextActionPerformed(evt);
}
});
resNoText.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
resNoTextFocusGained(evt);
}
});
staffIDInfoText.setBackground(new java.awt.Color(0, 0, 0));
staffIDInfoText.setForeground(new java.awt.Color(255, 255, 255));
staffIDInfoText.setText(" Enter staff/manager ID number");
staffIDInfoText.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
staffIDInfoText.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
staffIDInfoTextFocusGained(evt);
}
public void focusLost(java.awt.event.FocusEvent evt) {
staffIDInfoTextFocusLost(evt);
}
});
jButton1.setText("GO");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton3.setText("GO");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N
jLabel4.setText("LOCATIONS");
jLabel4.setToolTipText("");
jButton4.setBackground(new java.awt.Color(0, 0, 51));
jButton4.setForeground(new java.awt.Color(255, 255, 255));
jButton4.setText("LAUREL");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton5.setBackground(new java.awt.Color(0, 0, 51));
jButton5.setForeground(new java.awt.Color(255, 255, 255));
jButton5.setText("LARGO");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setBackground(new java.awt.Color(0, 0, 51));
jButton6.setForeground(new java.awt.Color(255, 255, 255));
jButton6.setText("BOWIE");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton7.setBackground(new java.awt.Color(0, 0, 51));
jButton7.setForeground(new java.awt.Color(255, 255, 255));
jButton7.setText("BALTIMORE");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jButton8.setText("Search");
jButton8.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
jTextField4.setBackground(new java.awt.Color(0, 0, 0));
jTextField4.setForeground(new java.awt.Color(255, 255, 255));
jTextField4.setText(" Enter Car Model");
jTextField4.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jTextField4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTextField4MouseClicked(evt);
}
});
jTextField4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField4ActionPerformed(evt);
}
});
jTextField4.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField4FocusGained(evt);
}
});
jButton9.setText("Search");
jButton9.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jTextField5.setBackground(new java.awt.Color(0, 0, 0));
jTextField5.setForeground(new java.awt.Color(255, 255, 255));
jTextField5.setText(" Enter Car Model");
jTextField5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jTextField5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTextField5MouseClicked(evt);
}
});
jTextField5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField5ActionPerformed(evt);
}
});
jTextField5.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField5FocusGained(evt);
}
});
jButton10.setText("Search");
jButton10.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jTextField6.setBackground(new java.awt.Color(0, 0, 0));
jTextField6.setForeground(new java.awt.Color(255, 255, 255));
jTextField6.setText(" Enter Car Model");
jTextField6.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jTextField6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTextField6MouseClicked(evt);
}
});
jTextField6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField6ActionPerformed(evt);
}
});
jTextField6.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField6FocusGained(evt);
}
});
jButton11.setText("Search");
jButton11.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});
jTextField7.setBackground(new java.awt.Color(0, 0, 0));
jTextField7.setForeground(new java.awt.Color(255, 255, 255));
jTextField7.setText(" Enter Car Model");
jTextField7.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jTextField7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTextField7MouseClicked(evt);
}
});
jTextField7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField7ActionPerformed(evt);
}
});
jTextField7.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField7FocusGained(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(174, 174, 174)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(jLabel2)
.addGap(4, 4, 4)
.addComponent(resNoText, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(91, 91, 91)
.addComponent(jLabel3)
.addGap(4, 4, 4)
.addComponent(staffIDInfoText, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(145, 145, 145)
.addComponent(jButton1)
.addGap(259, 259, 259)
.addComponent(jButton3)))
.addGap(29, 47, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(99, 99, 99)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(41, 41, 41)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 36, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(90, 90, 90)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(resNoText, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(5, 5, 5)
.addComponent(jLabel3))
.addComponent(staffIDInfoText, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jButton3)))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String sql="select * from OrderDetails where ResNo=?";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, resNoText.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
this.setVisible(false);
ReceiptPage s = new ReceiptPage(resNoText.getText());
s.setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Try again:\n Incorrect Reservation number");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton1ActionPerformed
private void resNoTextFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_resNoTextFocusGained
// TODO add your handling code here:
resNoText.setText("");
}//GEN-LAST:event_resNoTextFocusGained
private void staffIDInfoTextFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_staffIDInfoTextFocusGained
// TODO add your handling code here:
staffIDInfoText.setText("");
}//GEN-LAST:event_staffIDInfoTextFocusGained
private void staffIDInfoTextFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_staffIDInfoTextFocusLost
// TODO add your handling code here:
}//GEN-LAST:event_staffIDInfoTextFocusLost
private void resNoTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resNoTextActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_resNoTextActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
String sql="select * from StaffID where EmployeeID=?";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, staffIDInfoText.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
String staff = staffIDInfoText.getText();
if(staff.substring(0, 2).equals("MA")){
this.setVisible(false);
AdminPage s = new AdminPage(staffIDInfoText.getText());
s.setVisible(true);
}else if(staff.substring(0, 2).equals("IN")){
this.setVisible(false);
InsurancePage s = new InsurancePage(staffIDInfoText.getText());
s.setVisible(true);
}else{
this.setVisible(false);
StaffPage s = new StaffPage(staffIDInfoText.getText());
s.setVisible(true);
}
}else{
JOptionPane.showMessageDialog(null, "Wrong staff ID \n Try again");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
jTextField4.setVisible(false);
jButton8.setVisible(false);
jTextField6.setVisible(false);
jButton10.setVisible(false);
jTextField7.setVisible(false);
jButton11.setVisible(false);
jTextField5.setVisible(true);
jButton9.setVisible(true);
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// TODO add your handling code here:
jTextField5.setVisible(false);
jButton9.setVisible(false);
jTextField6.setVisible(false);
jButton10.setVisible(false);
jTextField7.setVisible(false);
jButton11.setVisible(false);
jTextField4.setVisible(true);
jButton8.setVisible(true);
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
// TODO add your handling code here:
String sql="select * from Vehicles where CarMake=? and Locations='Largo'";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, jTextField4.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
this.setVisible(false);
MakeOrder s = new MakeOrder(jTextField4.getText(), "Largo");
s.setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Try again:\nCar not in this store at this time");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton8ActionPerformed
private void jTextField4FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField4FocusGained
// TODO add your handling code here:
}//GEN-LAST:event_jTextField4FocusGained
private void jTextField4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField4MouseClicked
// TODO add your handling code here:
jTextField4.setText("");
}//GEN-LAST:event_jTextField4MouseClicked
private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField4ActionPerformed
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
// TODO add your handling code here:
// TODO add your handling code here:
String sql="select * from Vehicles where CarMake=? and Locations='Laurel'";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, jTextField5.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
this.setVisible(false);
MakeOrder s = new MakeOrder(jTextField5.getText(), "Laurel");
s.setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Try again:\nCar not in this store at this time");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton9ActionPerformed
private void jTextField5FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField5FocusGained
// TODO add your handling code here:
}//GEN-LAST:event_jTextField5FocusGained
private void jTextField5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField5MouseClicked
// TODO add your handling code here:
jTextField5.setText("");
}//GEN-LAST:event_jTextField5MouseClicked
private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField5ActionPerformed
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
// TODO add your handling code here:
String sql="select * from Vehicles where CarMake=? and Locations='Bowie'";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, jTextField6.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
this.setVisible(false);
MakeOrder s = new MakeOrder(jTextField6.getText(), "Bowie");
s.setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Try again:\nCar not in this store at this time");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton10ActionPerformed
private void jTextField6FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField6FocusGained
// TODO add your handling code here:
}//GEN-LAST:event_jTextField6FocusGained
private void jTextField6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField6MouseClicked
// TODO add your handling code here:
jTextField6.setText("");
}//GEN-LAST:event_jTextField6MouseClicked
private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField6ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField6ActionPerformed
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
// TODO add your handling code here:
String sql="select * from Vehicles where CarMake=? and Locations='Baltimore'";
try{
pst=conn.prepareStatement(sql);
pst.setString(1, jTextField7.getText());
rs=pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "Valid entry");
rs.close();
pst.close();
this.setVisible(false);
MakeOrder s = new MakeOrder(jTextField7.getText(), "Baltimore");
s.setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Try again:\nCar not in this store at this time");
}
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
//https://www.youtube.com/watch?v=vuI34kj7D60&list=PLB04B4E5D9B58C13D&index=6
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton11ActionPerformed
private void jTextField7FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField7FocusGained
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7FocusGained
private void jTextField7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField7MouseClicked
// TODO add your handling code here:
jTextField7.setText("");
}//GEN-LAST:event_jTextField7MouseClicked
private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
jTextField4.setVisible(false);
jButton8.setVisible(false);
jTextField5.setVisible(false);
jButton9.setVisible(false);
jTextField7.setVisible(false);
jButton11.setVisible(false);
jTextField6.setVisible(true);
jButton10.setVisible(true);
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
// TODO add your handling code here:
jTextField4.setVisible(false);
jButton8.setVisible(false);
jTextField5.setVisible(false);
jButton9.setVisible(false);
jTextField6.setVisible(false);
jButton10.setVisible(false);
jTextField7.setVisible(true);
jButton11.setVisible(true);
}//GEN-LAST:event_jButton7ActionPerformed
private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
// TODO add your handling code here:
jTextField4.setVisible(false);
jButton8.setVisible(false);
jTextField5.setVisible(false);
jButton9.setVisible(false);
jTextField6.setVisible(false);
jButton10.setVisible(false);
jTextField7.setVisible(false);
jButton11.setVisible(false);
}//GEN-LAST:event_formMouseClicked
private void resNoTextMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resNoTextMouseClicked
// TODO add your handling code here:
resNoText.setText("");
}//GEN-LAST:event_resNoTextMouseClicked
/**
* @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(LandingPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(LandingPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(LandingPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LandingPage.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 LandingPage().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField resNoText;
private javax.swing.JTextField staffIDInfoText;
// End of variables declaration//GEN-END:variables
}