-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser_Control_Panel_Page.java
More file actions
358 lines (324 loc) · 19.9 KB
/
Copy pathUser_Control_Panel_Page.java
File metadata and controls
358 lines (324 loc) · 19.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
import java.awt.Toolkit;
import java.util.Calendar;
import java.util.Date;
import java.sql.*;
import javax.swing.*;
import java.awt.*;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author root
*/
public class User_Control_Panel_Page extends javax.swing.JFrame {
String url="jdbc:mysql://localhost:3306/"; //sizde 3306 olabilir
String veritabaniadi="passbox_db"; // ulaşmak istediğiniz veri tabanı ismi
String surucu="com.mysql.jdbc.Driver";
String kullaniciAdi="root"; // workbench deki kullanıcı adınız ne ise o "root" olabilir
String kullaniciParolası="Aykutaylin1998"; //workbench deki şifreniz ne ise o
Connection baglanti=null;
Statement komut=null;
ResultSet gelenveri=null;
PreparedStatement pst=null;
/**
* Creates new form User_Control_Panel_Page
*/
public void baglanti(){
try {
Class.forName(surucu);
//baglantı veri tabanı seçimi kullanıcı adı ve parola ile sağlanı
baglanti= DriverManager.getConnection(url+veritabaniadi, kullaniciAdi,kullaniciParolası);
} catch (ClassNotFoundException | SQLException ex) {
System.out.println("HATA 1: Surucu ve Baglantı Hatsı !"+ex);
}
}
int id=-1;
public User_Control_Panel_Page() {
initComponents();
}
public User_Control_Panel_Page(int gid) {
initComponents();
setIcon();
Date today = new Date();
giris_saati_label.setText(today.toString());
id=gid;
}
User_Control_Panel_Page(int gidenid, String gidenad) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
/**
* 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() {
jButton7 = new javax.swing.JButton();
jButton_AboutUs = new javax.swing.JButton();
jButton_ContactMe = new javax.swing.JButton();
jButton_Exit = new javax.swing.JButton();
jLabel_User_Control_Panel_Page_usercontrolpanel = new javax.swing.JLabel();
jButton_UserEdit = new javax.swing.JButton();
jButton_Database = new javax.swing.JButton();
jButton_AddPassword = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
giris_saati_label = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
software_update_button = new javax.swing.JButton();
jButton7.setText("jButton7");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("PassBox | User Control Page");
setResizable(false);
jButton_AboutUs.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_AboutUs.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/about_me_ico.png"))); // NOI18N
jButton_AboutUs.setText("About Us");
jButton_AboutUs.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton_AboutUs.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton_AboutUs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_AboutUsActionPerformed(evt);
}
});
jButton_ContactMe.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_ContactMe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/contact_me_ico.png"))); // NOI18N
jButton_ContactMe.setText("Contact Me");
jButton_ContactMe.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton_ContactMe.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton_ContactMe.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_ContactMeActionPerformed(evt);
}
});
jButton_Exit.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/exit_ico.png"))); // NOI18N
jButton_Exit.setText("Exit");
jButton_Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_ExitActionPerformed(evt);
}
});
jLabel_User_Control_Panel_Page_usercontrolpanel.setFont(new java.awt.Font("Yu Gothic UI", 1, 20)); // NOI18N
jLabel_User_Control_Panel_Page_usercontrolpanel.setText("User Control Panel");
jButton_UserEdit.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_UserEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/user_edit_ico.png"))); // NOI18N
jButton_UserEdit.setText("User Edit");
jButton_UserEdit.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton_UserEdit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton_UserEdit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_UserEditActionPerformed(evt);
}
});
jButton_Database.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_Database.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/database_ico.png"))); // NOI18N
jButton_Database.setText("Database");
jButton_Database.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton_Database.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton_Database.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_DatabaseActionPerformed(evt);
}
});
jButton_AddPassword.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton_AddPassword.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/password_management_ico.png"))); // NOI18N
jButton_AddPassword.setText("Manage passwords");
jButton_AddPassword.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton_AddPassword.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton_AddPassword.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_AddPasswordActionPerformed(evt);
}
});
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/default_user_ico.png"))); // NOI18N
jLabel1.setText(".........");
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 15)); // NOI18N
jLabel2.setText("System Entry Time : ");
giris_saati_label.setText(" ");
jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/log_file.png"))); // NOI18N
jButton1.setText("Log Control");
jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
software_update_button.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
software_update_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ico/software-update.png"))); // NOI18N
software_update_button.setText("Software Update");
software_update_button.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
software_update_button.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
software_update_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
software_update_buttonActionPerformed(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()
.addContainerGap()
.addComponent(jLabel_User_Control_Panel_Page_usercontrolpanel)
.addGap(158, 158, 158)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(giris_saati_label, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(software_update_button, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton_UserEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jButton_AboutUs, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton_ContactMe, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jButton_AddPassword)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton_Database, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jButton_Exit, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(67, 67, 67)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel_User_Control_Panel_Page_usercontrolpanel, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
.addComponent(giris_saati_label, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton_UserEdit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton_AddPassword, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton_Database, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton_AboutUs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton_ContactMe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton_Exit, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(software_update_button, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(24, 24, 24))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ExitActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_jButton_ExitActionPerformed
private void jButton_UserEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_UserEditActionPerformed
// TODO add your handling code here:
User_Edit_Page frame = new User_Edit_Page(id);
frame.setVisible(true);
}//GEN-LAST:event_jButton_UserEditActionPerformed
private void jButton_AboutUsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_AboutUsActionPerformed
// TODO add your handling code here:
About_Us_Page frame = new About_Us_Page();
frame.setVisible(true);
}//GEN-LAST:event_jButton_AboutUsActionPerformed
private void jButton_AddPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_AddPasswordActionPerformed
// TODO add your handling code here:
Management_Password_Page frame = new Management_Password_Page();
frame.setVisible(true);
}//GEN-LAST:event_jButton_AddPasswordActionPerformed
private void jButton_DatabaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_DatabaseActionPerformed
// TODO add your handling code here:
Database_View frame = new Database_View();
frame.setVisible(true);
}//GEN-LAST:event_jButton_DatabaseActionPerformed
private void jButton_ContactMeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ContactMeActionPerformed
// TODO add your handling code here:
Contact_Me_Page frame = new Contact_Me_Page();
frame.setVisible(true);
}//GEN-LAST:event_jButton_ContactMeActionPerformed
private void software_update_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_software_update_buttonActionPerformed
// TODO add your handling code here:
Software_Update_Page frame_softwareupdatepage = new Software_Update_Page();
frame_softwareupdatepage.setVisible(true);
}//GEN-LAST:event_software_update_buttonActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
Log_Control_Page frame_logcontrolpage = new Log_Control_Page();
frame_logcontrolpage.setVisible(true);
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @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(User_Control_Panel_Page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(User_Control_Panel_Page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(User_Control_Panel_Page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(User_Control_Panel_Page.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 User_Control_Panel_Page().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel giris_saati_label;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton_AboutUs;
private javax.swing.JButton jButton_AddPassword;
private javax.swing.JButton jButton_ContactMe;
private javax.swing.JButton jButton_Database;
private javax.swing.JButton jButton_Exit;
private javax.swing.JButton jButton_UserEdit;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel_User_Control_Panel_Page_usercontrolpanel;
private javax.swing.JButton software_update_button;
// End of variables declaration//GEN-END:variables
private void setIcon() {
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("passbox_ico.png")));
}
}