-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.java
1618 lines (1418 loc) · 75.7 KB
/
Home.java
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
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* 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.
*/
package classes;
import java.awt.Color;
import java.awt.Font;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.table.JTableHeader;
import net.proteanit.sql.DbUtils;
/**
*
* @author wayomi
*/
public class Home extends javax.swing.JFrame {
Connection con;
PreparedStatement pst;
ResultSet rs;
SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd");
public static Double income;
public static Double expn;
public static Double purchase;
public static Double Rincome;
public static Double Rexpn;
public static Double Rpurchase;
public static Double inCash1;
public static Double crCash = 0.00;
public static Double crCash2 = 0.00;
public static Double cashBal = 0.00;
public static Double card1In = 0.00;
public static Double card2 = 0.00;
public static Double cardBal = 0.00;
public static Double PurCash = 0.00;
public static Double PurCard = 0.00;
public static Double PurTopay = 0.00;
public static Double PurOther = 0.00;
public static Double ExpCash = 0.00;
public static Double ExpCard = 0.00;
public static Double ExpTopay = 0.00;
public static Double ExpOther = 0.00;
public static Double BalCash = 0.00;
public static Double BalCard = 0.00;
public static Double BalTopay = 0.00;
public static Double IncCredit = 0.00;
public static Double PurCredit = 0.00;
public static Double ExpCredit = 0.00;
////Balance on View button/////////
public static Double Vcash1 = 0.00;
public static Double Vcash2 = 0.00;
public static Double Vcash3 = 0.00;
public static Double Vcard1 = 0.00;
public static Double Vcard2 = 0.00;
public static Double Vcard3 = 0.00;
public static Double VPurCash = 0.00;
public static Double VExpCash = 0.00;
public static Double VCash = 0.00;
public static Double VPurCard = 0.00;
public static Double VExpCard = 0.00;
public static Double VCard = 0.00;
public static Double VPurOther = 0.00;
public static Double VExpOther = 0.00;
public static Double VPurCredit = 0.00;
public static Double VExpCredit = 0.00;
public static Double VCredit = 0.00;
public static Double VBalCash = 0.00;
public static Double VBalCard = 0.00;
public static Double VBalCredit = 0.00;
public static Double VInCredit=0.00;
public static Double Incre = 0.0;
public Home() {
initComponents();
this.setLocationRelativeTo(this);
con = DBConnect.connect();
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
jLabel_incomeCash.setText("£ 0.00");
jLabel_incomeBank.setText("£ 0.00");
jLabel_incomeCredit.setText("£ 0.00");
jLabel_balace.setText("£ 0.00");
jLabel_purCash.setText("£ 0.00");
jLabel_purBank.setText("£ 0.00");
jLabel_purToPay.setText("£ 0.00");
jLabel_ExpCash.setText("£ 0.00");
jLabel_ExpBank.setText("£ 0.00");
jLabel_ExpToPay.setText("£ 0.00");
jLabel_purOther.setText("£ 0.00");
jLabel_ExpOther.setText("£ 0.00");
balance();
}
private void balance()
{
try {
String sql = "SELECT SUM(Total) AS 'pay' FROM purchase";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
purchase = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(Total) AS 'pay' FROM expences";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
expn = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(total) AS 'pay' FROM income";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
income = Double.parseDouble(tt);
}
}
catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
double balance = income - (purchase+expn);
String BalS = String.format("%.2f", balance);
jLabel_balace.setText(" £ "+BalS);
}
private void balance_range()
{
try {
String sql = "SELECT SUM(Total) AS 'pay' FROM purchase Where (date between ? and ?)";
PreparedStatement pst = con.prepareStatement(sql);
String from = sdf.format(jDateChooser1.getDate());
pst.setString(1,from);
String to = sdf.format(jDateChooser2.getDate());
pst.setString(2,to);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
Rpurchase = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(Total) AS 'pay' FROM expences Where (date between ? and ?)";
PreparedStatement pst = con.prepareStatement(sql);
String from = sdf.format(jDateChooser1.getDate());
pst.setString(1,from);
String to = sdf.format(jDateChooser2.getDate());
pst.setString(2,to);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
Rexpn = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(total) AS 'pay' FROM income Where (date between ? and ?)";
PreparedStatement pst = con.prepareStatement(sql);
String from = sdf.format(jDateChooser1.getDate());
pst.setString(1,from);
String to = sdf.format(jDateChooser2.getDate());
pst.setString(2,to);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
Rincome = Double.parseDouble(tt);
}
}
catch (Exception e) {//JOptionPane.showMessageDialog(null, e);
}
double balance = Rincome - Rpurchase- Rexpn;
String BalS = String.format("%.2f", balance);
jLabel_balace.setText(" £ "+BalS);
}
/**
* 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() {
heading = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
slide = new javax.swing.JPanel();
jLabel_dashboard = new javax.swing.JLabel();
jLabel_Income = new javax.swing.JLabel();
jLabel_outgoing = new javax.swing.JLabel();
jLabel_reports = new javax.swing.JLabel();
jLabel_staff = new javax.swing.JLabel();
jLabel_vendor = new javax.swing.JLabel();
jLabel_vendor1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jLabel_incomeCash = new javax.swing.JLabel();
jLabel_incomeBank = new javax.swing.JLabel();
jLabel_incomeCredit = new javax.swing.JLabel();
jLabel_purCash = new javax.swing.JLabel();
jLabel_purBank = new javax.swing.JLabel();
jLabel_purToPay = new javax.swing.JLabel();
jLabel_ExpCash = new javax.swing.JLabel();
jLabel_ExpBank = new javax.swing.JLabel();
jLabel_ExpToPay = new javax.swing.JLabel();
jDateChooser1 = new com.toedter.calendar.JDateChooser();
jDateChooser2 = new com.toedter.calendar.JDateChooser();
jButton1 = new javax.swing.JButton();
jLabel_balace = new javax.swing.JLabel();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
jLabel26 = new javax.swing.JLabel();
jLabel_BCash = new javax.swing.JLabel();
jLabel_BBank = new javax.swing.JLabel();
jLabel_BToPay = new javax.swing.JLabel();
jLabel89 = new javax.swing.JLabel();
jLabel_purOther = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
jLabel_ExpOther = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jScrollPane2 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMaximumSize(new java.awt.Dimension(1172, 745));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
heading.setBackground(new java.awt.Color(51, 51, 51));
jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("IOM - Income~Outgoing Manager - Dashboard");
javax.swing.GroupLayout headingLayout = new javax.swing.GroupLayout(heading);
heading.setLayout(headingLayout);
headingLayout.setHorizontalGroup(
headingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(headingLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 572, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
headingLayout.setVerticalGroup(
headingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headingLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6)
.addContainerGap())
);
slide.setBackground(new java.awt.Color(255, 255, 255));
jLabel_dashboard.setBackground(new java.awt.Color(204, 255, 204));
jLabel_dashboard.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_dashboard.setForeground(new java.awt.Color(0, 51, 51));
jLabel_dashboard.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_dashboard.setText("Dashboard");
jLabel_dashboard.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jLabel_Income.setBackground(new java.awt.Color(204, 255, 204));
jLabel_Income.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_Income.setForeground(new java.awt.Color(0, 51, 51));
jLabel_Income.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_Income.setText("Income");
jLabel_Income.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_IncomeMouseClicked(evt);
}
});
jLabel_outgoing.setBackground(new java.awt.Color(204, 255, 204));
jLabel_outgoing.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_outgoing.setForeground(new java.awt.Color(0, 51, 51));
jLabel_outgoing.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_outgoing.setText("Outgoing");
jLabel_outgoing.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_outgoingMouseClicked(evt);
}
});
jLabel_reports.setBackground(new java.awt.Color(204, 255, 204));
jLabel_reports.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_reports.setForeground(new java.awt.Color(0, 51, 51));
jLabel_reports.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_reports.setText("Reports");
jLabel_reports.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_reportsMouseClicked(evt);
}
});
jLabel_staff.setBackground(new java.awt.Color(204, 255, 204));
jLabel_staff.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_staff.setForeground(new java.awt.Color(0, 51, 51));
jLabel_staff.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_staff.setText("Staff");
jLabel_staff.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_staffMouseClicked(evt);
}
});
jLabel_vendor.setBackground(new java.awt.Color(204, 255, 204));
jLabel_vendor.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_vendor.setForeground(new java.awt.Color(0, 51, 51));
jLabel_vendor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_vendor.setText("New Vendor");
jLabel_vendor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_vendorMouseClicked(evt);
}
});
jLabel_vendor1.setBackground(new java.awt.Color(204, 255, 204));
jLabel_vendor1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel_vendor1.setForeground(new java.awt.Color(0, 51, 51));
jLabel_vendor1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel_vendor1.setText("Credit");
jLabel_vendor1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel_vendor1MouseClicked(evt);
}
});
javax.swing.GroupLayout slideLayout = new javax.swing.GroupLayout(slide);
slide.setLayout(slideLayout);
slideLayout.setHorizontalGroup(
slideLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel_dashboard, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
.addComponent(jLabel_Income, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel_outgoing, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel_reports, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel_staff, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel_vendor, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel_vendor1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
slideLayout.setVerticalGroup(
slideLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(slideLayout.createSequentialGroup()
.addComponent(jLabel_dashboard, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_Income, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_outgoing, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_reports, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_staff, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_vendor, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel_vendor1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel8.setForeground(new java.awt.Color(0, 51, 51));
jLabel8.setText("INCOME");
jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel9.setForeground(new java.awt.Color(0, 51, 51));
jLabel9.setText("OUTGOING");
jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel10.setForeground(new java.awt.Color(0, 51, 51));
jLabel10.setText("BALANCE");
jLabel11.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel11.setForeground(new java.awt.Color(0, 204, 204));
jLabel11.setText("CASH");
jLabel12.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel12.setForeground(new java.awt.Color(0, 204, 204));
jLabel12.setText("CARD");
jLabel13.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel13.setForeground(new java.awt.Color(0, 204, 204));
jLabel13.setText("CREDIT");
jLabel14.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel14.setForeground(new java.awt.Color(102, 0, 153));
jLabel14.setText("Purchase");
jLabel15.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel15.setForeground(new java.awt.Color(102, 0, 153));
jLabel15.setText("Expences");
jLabel16.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel16.setForeground(new java.awt.Color(0, 204, 51));
jLabel16.setText("CASH");
jLabel17.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel17.setForeground(new java.awt.Color(0, 204, 51));
jLabel17.setText("BANK");
jLabel18.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel18.setForeground(new java.awt.Color(0, 204, 51));
jLabel18.setText("TO PAY");
jLabel19.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel19.setForeground(new java.awt.Color(255, 0, 102));
jLabel19.setText("CASH");
jLabel20.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel20.setForeground(new java.awt.Color(255, 0, 102));
jLabel20.setText("BANK");
jLabel21.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel21.setForeground(new java.awt.Color(255, 0, 102));
jLabel21.setText("TO PAY");
jLabel_incomeCash.setBackground(new java.awt.Color(204, 255, 204));
jLabel_incomeCash.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_incomeCash.setForeground(new java.awt.Color(0, 204, 204));
jLabel_incomeBank.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_incomeBank.setForeground(new java.awt.Color(0, 204, 204));
jLabel_incomeCredit.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_incomeCredit.setForeground(new java.awt.Color(0, 204, 204));
jLabel_purCash.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_purCash.setForeground(new java.awt.Color(0, 204, 51));
jLabel_purBank.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_purBank.setForeground(new java.awt.Color(0, 204, 51));
jLabel_purToPay.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_purToPay.setForeground(new java.awt.Color(0, 204, 51));
jLabel_ExpCash.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_ExpCash.setForeground(new java.awt.Color(255, 0, 102));
jLabel_ExpBank.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_ExpBank.setForeground(new java.awt.Color(255, 0, 102));
jLabel_ExpToPay.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_ExpToPay.setForeground(new java.awt.Color(255, 0, 102));
jButton1.setBackground(new java.awt.Color(204, 204, 204));
jButton1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icons8-view-20.png"))); // NOI18N
jButton1.setText("SUMMARY");
jButton1.setIconTextGap(16);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel_balace.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_balace.setForeground(new java.awt.Color(0, 0, 255));
jLabel24.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel24.setForeground(new java.awt.Color(0, 0, 255));
jLabel24.setText("CASH");
jLabel25.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel25.setForeground(new java.awt.Color(0, 0, 255));
jLabel25.setText("BANK");
jLabel26.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel26.setForeground(new java.awt.Color(0, 0, 255));
jLabel26.setText("TO PAY");
jLabel_BCash.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_BCash.setForeground(new java.awt.Color(0, 0, 255));
jLabel_BBank.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_BBank.setForeground(new java.awt.Color(0, 0, 255));
jLabel_BToPay.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_BToPay.setForeground(new java.awt.Color(0, 0, 255));
jLabel89.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel89.setForeground(new java.awt.Color(0, 204, 51));
jLabel89.setText("OTHER");
jLabel_purOther.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_purOther.setForeground(new java.awt.Color(0, 204, 51));
jLabel27.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
jLabel27.setForeground(new java.awt.Color(255, 0, 102));
jLabel27.setText("OTHER");
jLabel_ExpOther.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jLabel_ExpOther.setForeground(new java.awt.Color(255, 0, 102));
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()
.addGap(67, 67, 67)
.addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(56, 56, 56)
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(47, 47, 47)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(65, 65, 65)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel11)
.addGap(31, 31, 31)
.addComponent(jLabel_incomeCash, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(29, 29, 29)
.addComponent(jLabel16)
.addGap(34, 34, 34)
.addComponent(jLabel_purCash, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(69, 69, 69)
.addComponent(jLabel19)
.addGap(31, 31, 31)
.addComponent(jLabel_ExpCash, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(72, 72, 72)
.addComponent(jLabel24)
.addGap(23, 23, 23)
.addComponent(jLabel_BCash, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel8)
.addGap(203, 203, 203)
.addComponent(jLabel9))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(187, 187, 187)
.addComponent(jLabel14)
.addGap(164, 164, 164)
.addComponent(jLabel15)))
.addGap(159, 159, 159)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel_balace, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(44, 44, 44))
.addComponent(jLabel10))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel12)
.addGap(31, 31, 31)
.addComponent(jLabel_incomeBank, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addComponent(jLabel17)
.addGap(34, 34, 34)
.addComponent(jLabel_purBank, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(60, 60, 60))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel13)
.addGap(18, 18, 18)
.addComponent(jLabel_incomeCredit, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel89)
.addGap(21, 21, 21)
.addComponent(jLabel_purOther, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel18)
.addGap(21, 21, 21)
.addComponent(jLabel_purToPay, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(49, 49, 49)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel27)
.addGap(28, 28, 28)
.addComponent(jLabel_ExpOther, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel21)
.addGap(18, 18, 18)
.addComponent(jLabel_ExpToPay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel20)
.addGap(31, 31, 31)
.addComponent(jLabel_ExpBank, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(71, 71, 71)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel25)
.addGap(23, 23, 23)
.addComponent(jLabel_BBank, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel26)
.addGap(10, 10, 10)
.addComponent(jLabel_BToPay, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
.addGap(67, 67, 67))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addComponent(jLabel10))
.addGap(2, 2, 2)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel_balace, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel14)
.addComponent(jLabel15))))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel11)
.addComponent(jLabel_incomeCash, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel16)
.addComponent(jLabel_purCash, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19)
.addComponent(jLabel24)))
.addComponent(jLabel_BCash, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel_ExpCash, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel12))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel_incomeBank, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel17))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addComponent(jLabel20))
.addComponent(jLabel_ExpBank, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addComponent(jLabel25))
.addComponent(jLabel_BBank, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jLabel_purBank, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(22, 22, 22)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel13)
.addComponent(jLabel_incomeCredit, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel18)
.addComponent(jLabel_purToPay, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel_ExpToPay, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel_BToPay, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel21)
.addComponent(jLabel26)))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel89)
.addComponent(jLabel_purOther, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel27)
.addComponent(jLabel_ExpOther, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(21, 21, 21))
);
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jTable1.setAutoCreateRowSorter(true);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Invoice Number", "Name", "Amount", "Date (Payment)"
}
) {
boolean[] canEdit = new boolean [] {
true, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jTable1.setGridColor(new java.awt.Color(102, 102, 255));
jTable1.setMaximumSize(new java.awt.Dimension(100, 64));
jTable1.setPreferredSize(new java.awt.Dimension(700, 400));
jTable1.setSelectionBackground(new java.awt.Color(204, 204, 204));
jScrollPane1.setViewportView(jTable1);
jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 40, 480, 260));
jTable2.setAutoCreateRowSorter(true);
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Invoice Number", "Name", "Amount", "Date (Payment)"
}
) {
boolean[] canEdit = new boolean [] {
true, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jTable2.setGridColor(new java.awt.Color(102, 102, 255));
jTable2.setMaximumSize(new java.awt.Dimension(100, 64));
jTable2.setPreferredSize(new java.awt.Dimension(700, 400));
jTable2.setSelectionBackground(new java.awt.Color(204, 204, 204));
jScrollPane2.setViewportView(jTable2);
jPanel2.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, 490, 260));
jLabel22.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel22.setForeground(new java.awt.Color(0, 83, 90));
jLabel22.setText("Purchases Due Today");
jPanel2.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));
jLabel23.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
jLabel23.setForeground(new java.awt.Color(0, 83, 90));
jLabel23.setText("Expences Due Today ");
jPanel2.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 10, -1, -1));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(heading, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(slide, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 995, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(heading, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(slide, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE))))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jLabel_IncomeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel_IncomeMouseClicked
Income i = new Income();
i.setVisible(true);
setVisible(false);
}//GEN-LAST:event_jLabel_IncomeMouseClicked
private void jLabel_outgoingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel_outgoingMouseClicked
Outgoing o = new Outgoing();
o.setVisible(true);
setVisible(false);
}//GEN-LAST:event_jLabel_outgoingMouseClicked
private void jLabel_reportsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel_reportsMouseClicked
Reports r = new Reports();
r.setVisible(true);
setVisible(false);
}//GEN-LAST:event_jLabel_reportsMouseClicked
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
try {
String sql = "SELECT InvoiceNo AS 'Invoice Number', Name, Total AS 'Total (£)', "
+ "paidDate AS '1st Installment',(Total - insAmount) As '1st Payment', insDate AS '2nd Installment',insAmount AS '2nd Payment' "
+ "FROM purchase WHERE (paidDate =? OR insDate = ?) and method ='NOT PAID' ";
pst = con.prepareStatement(sql);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime now = LocalDateTime.now();
pst.setString(1, dtf.format(now));
pst.setString(2, dtf.format(now));
rs = pst.executeQuery();
JTableHeader head = jTable2.getTableHeader();
head.setForeground(Color.blue);
jTable2.getTableHeader().setFont(new Font("Times New Roman", Font.BOLD, 14));
jTable2.setModel(DbUtils.resultSetToTableModel(rs));
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT InvoiceNo AS 'Invoice Number', Name, Total AS 'Total (£)', "
+ "paidDate AS '1st Installment',(Total - insAmount) As '1st Payment', insDate AS '2nd Installment',insAmount AS '2nd Payment'"
+ "FROM expences WHERE paidDate =? OR insDate = ? and method ='NOT PAID' ";
pst = con.prepareStatement(sql);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime now = LocalDateTime.now();
pst.setString(1, dtf.format(now));
pst.setString(2, dtf.format(now));
rs = pst.executeQuery();
JTableHeader head = jTable1.getTableHeader();
head.setForeground(Color.blue);
jTable1.getTableHeader().setFont(new Font("Times New Roman", Font.BOLD, 14));
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(cash) AS 'pay' FROM income";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
inCash1 = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null,e);
}
try {
String sql = "SELECT SUM(cash) AS 'pay' FROM credit";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
crCash = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null,e);
}
cashBal= inCash1 + crCash ;
String v1 = String.format("%.2f", cashBal);
jLabel_incomeCash.setText(" £ "+v1);
////////////*******************/////////////////
try {
String sql = "SELECT SUM(bank) AS 'pay' FROM income";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
card1In = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
try {
String sql = "SELECT SUM(card) AS 'pay' FROM credit";
PreparedStatement pst = con.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next())
{
String tt = rs.getString("pay");
card2 = Double.parseDouble(tt);
}
}
catch (Exception e) {
//JOptionPane.showMessageDialog(null, e);
}
cardBal = card1In + card2;
String v2= String.format("%.2f", cardBal);
jLabel_incomeBank.setText(" £ "+v2);
////////////*******************/////////////////
try {
String sql = "SELECT SUM(balance) AS 'pay' FROM credit";
PreparedStatement pst = con.prepareStatement(sql);