-
Notifications
You must be signed in to change notification settings - Fork 0
/
Member.java
619 lines (536 loc) · 30.4 KB
/
Member.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
/*
* 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 com.gym;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
/**
*
* @author ACER RYZEN 5
*/
public class Member extends javax.swing.JPanel implements database {
String user, password;
static Connection conn;
static Statement stmt;
static ResultSet rs;
BuyPackage buying = new BuyPackage();
/**
* Creates new form Member
*/
public Member() {
initComponents();
}
/**
* 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() {
bodyPanel = new javax.swing.JPanel();
mainPanel = new javax.swing.JPanel();
paketmemberPanel = new javax.swing.JPanel();
BasicButton = new javax.swing.JButton();
PremiumButton = new javax.swing.JButton();
PaketTitle = new javax.swing.JLabel();
premiumTField = new javax.swing.JTextField();
basicTField = new javax.swing.JTextField();
Cancel1 = new javax.swing.JButton();
informasiakunPanel = new javax.swing.JPanel();
Title = new javax.swing.JLabel();
Lnama = new javax.swing.JLabel();
Lnik = new javax.swing.JLabel();
Lemail = new javax.swing.JLabel();
Ltanggallahir = new javax.swing.JLabel();
LtanggalBergabung = new javax.swing.JLabel();
TtanggalBergabung = new javax.swing.JTextField();
TtanggalLahir = new javax.swing.JTextField();
Temail = new javax.swing.JTextField();
Tnik = new javax.swing.JTextField();
Tnama = new javax.swing.JTextField();
LnoHp = new javax.swing.JLabel();
Lalamat = new javax.swing.JLabel();
TnoHP = new javax.swing.JTextField();
Talamat = new javax.swing.JTextField();
btnBack = new javax.swing.JButton();
Lstatus = new javax.swing.JLabel();
Tstatus = new javax.swing.JTextField();
ubahPassword = new javax.swing.JPanel();
Lpl = new javax.swing.JLabel();
Lpb = new javax.swing.JLabel();
Lkpb = new javax.swing.JLabel();
Tpl = new javax.swing.JPasswordField();
Tpb = new javax.swing.JPasswordField();
Tkpb = new javax.swing.JPasswordField();
btnKonfirmasi = new javax.swing.JToggleButton();
Cancel = new javax.swing.JButton();
setLayout(new java.awt.CardLayout());
mainPanel.setMaximumSize(new java.awt.Dimension(600, 400));
mainPanel.setMinimumSize(new java.awt.Dimension(600, 400));
mainPanel.setPreferredSize(new java.awt.Dimension(600, 400));
mainPanel.setLayout(new java.awt.CardLayout());
paketmemberPanel.setMinimumSize(new java.awt.Dimension(540, 370));
BasicButton.setText("BASIC");
BasicButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BasicButtonActionPerformed(evt);
}
});
PremiumButton.setText("PREMIUM");
PremiumButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PremiumButtonActionPerformed(evt);
}
});
PaketTitle.setFont(new java.awt.Font("Mistral", 0, 24)); // NOI18N
PaketTitle.setText("Pilihan Paket Member");
premiumTField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
premiumTFieldActionPerformed(evt);
}
});
Cancel1.setText("Cancel");
Cancel1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Cancel1ActionPerformed(evt);
}
});
javax.swing.GroupLayout paketmemberPanelLayout = new javax.swing.GroupLayout(paketmemberPanel);
paketmemberPanel.setLayout(paketmemberPanelLayout);
paketmemberPanelLayout.setHorizontalGroup(
paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGap(216, 216, 216)
.addComponent(Cancel1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGap(71, 71, 71)
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGap(108, 108, 108)
.addComponent(PaketTitle))
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(BasicButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(basicTField, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(55, 55, 55)
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(PremiumButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(premiumTField, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addContainerGap(142, Short.MAX_VALUE))
);
paketmemberPanelLayout.setVerticalGroup(
paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(paketmemberPanelLayout.createSequentialGroup()
.addGap(36, 36, 36)
.addComponent(PaketTitle)
.addGap(46, 46, 46)
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(BasicButton)
.addComponent(PremiumButton))
.addGap(18, 18, 18)
.addGroup(paketmemberPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(premiumTField)
.addComponent(basicTField, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(Cancel1)
.addContainerGap(85, Short.MAX_VALUE))
);
mainPanel.add(paketmemberPanel, "card11");
Title.setFont(new java.awt.Font("Tw Cen MT", 1, 18)); // NOI18N
Title.setText("INFORMASI AKUN");
Lnama.setText("Nama");
Lnik.setText("NIK");
Lemail.setText("Email");
Ltanggallahir.setText("Tanggal lahir");
LtanggalBergabung.setText("Tanggal bergabung");
Temail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TemailActionPerformed(evt);
}
});
Tnama.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TnamaActionPerformed(evt);
}
});
LnoHp.setText("No hp");
Lalamat.setText("Alamat");
Talamat.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TalamatActionPerformed(evt);
}
});
btnBack.setText("Kembali");
btnBack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBackActionPerformed(evt);
}
});
Lstatus.setText("Status Member");
javax.swing.GroupLayout informasiakunPanelLayout = new javax.swing.GroupLayout(informasiakunPanel);
informasiakunPanel.setLayout(informasiakunPanelLayout);
informasiakunPanelLayout.setHorizontalGroup(
informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Title)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Ltanggallahir)
.addComponent(Lemail)
.addComponent(Lnik)
.addComponent(Lnama))
.addGap(50, 50, 50)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(TtanggalLahir, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
.addComponent(Temail)
.addComponent(Tnik)
.addComponent(Tnama))
.addGap(46, 46, 46)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(LnoHp)
.addComponent(Lalamat))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Talamat, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(TnoHP, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addComponent(LtanggalBergabung)
.addGap(18, 18, 18)
.addComponent(TtanggalBergabung, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addComponent(Lstatus)
.addGap(39, 39, 39)
.addComponent(Tstatus, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGap(234, 234, 234)
.addComponent(btnBack)))
.addContainerGap(80, Short.MAX_VALUE))
);
informasiakunPanelLayout.setVerticalGroup(
informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(Title)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lnama)
.addComponent(Tnama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(Lnik)
.addComponent(Tnik, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lemail)
.addComponent(Temail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Ltanggallahir)
.addComponent(TtanggalLahir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(informasiakunPanelLayout.createSequentialGroup()
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(TnoHP, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(LnoHp))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lalamat)
.addComponent(Talamat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lstatus)
.addComponent(Tstatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(informasiakunPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, informasiakunPanelLayout.createSequentialGroup()
.addComponent(LtanggalBergabung)
.addGap(6, 6, 6))
.addComponent(TtanggalBergabung, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(62, 62, 62)
.addComponent(btnBack)
.addGap(28, 28, 28))
);
mainPanel.add(informasiakunPanel, "card6");
ubahPassword.setMinimumSize(new java.awt.Dimension(540, 370));
Lpl.setText("Password Lama");
Lpb.setText("Password Baru");
Lkpb.setText("Konfirmasi Password");
btnKonfirmasi.setText("OK");
btnKonfirmasi.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnKonfirmasiActionPerformed(evt);
}
});
Cancel.setText("Cancel");
Cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CancelActionPerformed(evt);
}
});
javax.swing.GroupLayout ubahPasswordLayout = new javax.swing.GroupLayout(ubahPassword);
ubahPassword.setLayout(ubahPasswordLayout);
ubahPasswordLayout.setHorizontalGroup(
ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addGap(120, 120, 120)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(Lpb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Lpl, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE))
.addGap(65, 65, 65)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Tpb)
.addComponent(Tpl)))
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addComponent(Lkpb)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
.addComponent(Tkpb, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addGap(170, 170, 170)
.addComponent(btnKonfirmasi, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Cancel, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(119, 119, 119))
);
ubahPasswordLayout.setVerticalGroup(
ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ubahPasswordLayout.createSequentialGroup()
.addGap(68, 68, 68)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lpl)
.addComponent(Tpl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lpb)
.addComponent(Tpb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Lkpb)
.addComponent(Tkpb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(54, 54, 54)
.addGroup(ubahPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnKonfirmasi)
.addComponent(Cancel))
.addContainerGap(103, Short.MAX_VALUE))
);
mainPanel.add(ubahPassword, "card11");
javax.swing.GroupLayout bodyPanelLayout = new javax.swing.GroupLayout(bodyPanel);
bodyPanel.setLayout(bodyPanelLayout);
bodyPanelLayout.setHorizontalGroup(
bodyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(bodyPanelLayout.createSequentialGroup()
.addGap(177, 177, 177)
.addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
bodyPanelLayout.setVerticalGroup(
bodyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
);
add(bodyPanel, "card2");
}// </editor-fold>//GEN-END:initComponents
private void BasicButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BasicButtonActionPerformed
// TODO add your handling code here:
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
buying.setLogin(user, password);
mainPanel.add(buying.getBuyBasic());
mainPanel.repaint();
mainPanel.revalidate();
}//GEN-LAST:event_BasicButtonActionPerformed
private void PremiumButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PremiumButtonActionPerformed
// TODO add your handling code here:
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
buying.setLogin(user, password);
mainPanel.add(buying.getBuyPremium());
mainPanel.repaint();
mainPanel.revalidate();
}//GEN-LAST:event_PremiumButtonActionPerformed
private void premiumTFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_premiumTFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_premiumTFieldActionPerformed
private void TnamaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TnamaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TnamaActionPerformed
private void TemailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TemailActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TemailActionPerformed
private void TalamatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TalamatActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TalamatActionPerformed
private void CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelActionPerformed
// TODO add your handling code here:
kembali();
}//GEN-LAST:event_CancelActionPerformed
private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackActionPerformed
// TODO add your handling code here:
kembali();
}//GEN-LAST:event_btnBackActionPerformed
private void Cancel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Cancel1ActionPerformed
// TODO add your handling code here:
kembali();
}//GEN-LAST:event_Cancel1ActionPerformed
private void btnKonfirmasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKonfirmasiActionPerformed
// TODO add your handling code here:
try {
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
String tpl=Tpl.getText();
String tpb=Tpb.getText();
String tkpb=Tkpb.getText();
System.out.println(tpl);
System.out.println(password);
System.out.println(tpb);
System.out.println(tpb);
if(tpl.equals(password)&&tpb.equals(tkpb)){
String sql = "UPDATE Member SET Password='"+tpb+"' WHERE Email='"+user+"'";
stmt.execute(sql);
JOptionPane.showMessageDialog(null, "Ubah Password Berhasil!", "", JOptionPane.INFORMATION_MESSAGE);
}
else{
JOptionPane.showMessageDialog(null, "Ubah Password Gagal!", "", JOptionPane.ERROR_MESSAGE);
}
stmt.close();
conn.close();
kembali();
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Pengambilan Data Gagal", "", JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_btnKonfirmasiActionPerformed
public JPanel getInfoAkun()
{
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
setAkunInfo();
mainPanel.add(informasiakunPanel);
mainPanel.repaint();
mainPanel.revalidate();
return mainPanel;
}
public JPanel getPaketMember()
{
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
mainPanel.add(paketmemberPanel);
mainPanel.repaint();
mainPanel.revalidate();
return mainPanel;
}
public JPanel getEditPassword()
{
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
mainPanel.add(ubahPassword);
mainPanel.repaint();
mainPanel.revalidate();
return mainPanel;
}
public void kembali()
{
mainPanel.removeAll();
mainPanel.repaint();
mainPanel.revalidate();
Login logon = new Login();
mainPanel.add(logon.getMemberPanel());
mainPanel.repaint();
mainPanel.revalidate();
}
public void setAkunInfo()
{
try {
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
String sql = "SELECT * FROM Member WHERE Email='"+user+"' AND Password='"+password+"'";
rs = stmt.executeQuery(sql);
while (rs.next()) {
Tnama.setText(rs.getString("Nama"));
Tnik.setText(rs.getString("NIK"));
Temail.setText(rs.getString("Email"));
TtanggalLahir.setText(rs.getString("TanggalLahir"));
Tstatus.setText(rs.getString("StatusMember"));
TnoHP.setText(rs.getString("NomorHP"));
Talamat.setText(rs.getString("AlamatLengkap"));
TtanggalBergabung.setText(rs.getString("TanggalMulaiBergabung"));
}
stmt.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Pengambilan Data Gagal", "", JOptionPane.ERROR_MESSAGE);
}
}
public void setLoginInfo(String getUser, String getPassword)
{
user = getUser;
password = getPassword;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton BasicButton;
private javax.swing.JButton Cancel;
private javax.swing.JButton Cancel1;
private javax.swing.JLabel Lalamat;
private javax.swing.JLabel Lemail;
private javax.swing.JLabel Lkpb;
private javax.swing.JLabel Lnama;
private javax.swing.JLabel Lnik;
private javax.swing.JLabel LnoHp;
private javax.swing.JLabel Lpb;
private javax.swing.JLabel Lpl;
private javax.swing.JLabel Lstatus;
private javax.swing.JLabel LtanggalBergabung;
private javax.swing.JLabel Ltanggallahir;
private javax.swing.JLabel PaketTitle;
private javax.swing.JButton PremiumButton;
private javax.swing.JTextField Talamat;
private javax.swing.JTextField Temail;
private javax.swing.JLabel Title;
private javax.swing.JPasswordField Tkpb;
private javax.swing.JTextField Tnama;
private javax.swing.JTextField Tnik;
private javax.swing.JTextField TnoHP;
private javax.swing.JPasswordField Tpb;
private javax.swing.JPasswordField Tpl;
private javax.swing.JTextField Tstatus;
private javax.swing.JTextField TtanggalBergabung;
private javax.swing.JTextField TtanggalLahir;
private javax.swing.JTextField basicTField;
private javax.swing.JPanel bodyPanel;
private javax.swing.JButton btnBack;
private javax.swing.JToggleButton btnKonfirmasi;
private javax.swing.JPanel informasiakunPanel;
private javax.swing.JPanel mainPanel;
private javax.swing.JPanel paketmemberPanel;
private javax.swing.JTextField premiumTField;
private javax.swing.JPanel ubahPassword;
// End of variables declaration//GEN-END:variables
}