-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLiveResultStd.java
More file actions
532 lines (459 loc) · 26.3 KB
/
LiveResultStd.java
File metadata and controls
532 lines (459 loc) · 26.3 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
/*
* 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 java_v1;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import net.proteanit.sql.DbUtils;
/**
*
* @author Krishno Dey
*/
public class LiveResultStd extends javax.swing.JFrame {
Connection con;
ResultSet rs;
PreparedStatement pst;
/**
* Creates new form LiveResultStd
*/
public LiveResultStd() {
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.
*/
public void LiveResultShowTable(){
String courseid=jCid.getText();
String sql="Select Quiz1,Quiz2,Quiz3,Midterm,MidtermImprovement from LiveResult where ID=? and CourseID=? ";
try {
pst=con.prepareStatement(sql);
pst.setInt(1,Integer.parseInt(jID.getText()));
pst.setString(2, courseid);
rs = pst.executeQuery();
jTable2.setModel(DbUtils.resultSetToTableModel(rs));
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,ex);
}
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jCourseID = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
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();
jScrollPane2 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jLabel15 = new javax.swing.JLabel();
jCid = new javax.swing.JTextField();
jCourseName = new javax.swing.JTextField();
jScrollPane3 = new javax.swing.JScrollPane();
jTable = new javax.swing.JTable();
jButton3 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jID = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jSemester = new javax.swing.JComboBox<>();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(0, 102, 153));
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("Student Information System");
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
jLabel2.setText("Live Result");
jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/images/diu_64px.png"))); // NOI18N
jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-report-card-40.png"))); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(212, 212, 212)
.addComponent(jLabel1)
.addGap(0, 211, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(423, 423, 423)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(355, 355, 355))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel2)))
.addContainerGap())
);
jLabel6.setBackground(java.awt.SystemColor.textHighlight);
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel6.setText("Registered Course List");
jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel8.setText("See Result");
jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-eye-24.png"))); // NOI18N
jLabel14.setBackground(new java.awt.Color(204, 204, 204));
jLabel14.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel14.setText("Live Result:");
jTable2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Quiz1", "Quiz2", "Quiz3", " Midterm", "MidtermImprovement"
}
));
jTable2.setRowHeight(20);
jScrollPane2.setViewportView(jTable2);
jButton1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-back-arrow-24.png"))); // NOI18N
jButton1.setText("Back");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel15.setText("Enter CourseID");
jCid.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jCourseName.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jTable.setFont(new java.awt.Font("Tahoma", 1, 20)); // NOI18N
jTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"CourseID", "CourseName", "Credit", "Section", "Teacher"
}
));
jTable.setRowHeight(26);
jScrollPane3.setViewportView(jTable);
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-forward-20.png"))); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
javax.swing.GroupLayout jCourseIDLayout = new javax.swing.GroupLayout(jCourseID);
jCourseID.setLayout(jCourseIDLayout);
jCourseIDLayout.setHorizontalGroup(
jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel15)
.addGap(18, 18, 18)
.addComponent(jCid, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton3)
.addGap(28, 28, 28)
.addComponent(jLabel14)
.addGap(18, 18, 18)
.addComponent(jCourseName, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jCourseIDLayout.createSequentialGroup()
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jLabel8))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jCourseIDLayout.createSequentialGroup()
.addGap(62, 62, 62)
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 836, Short.MAX_VALUE)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel10)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane3))))))
.addGroup(jCourseIDLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6)
.addGap(352, 352, 352)))
.addContainerGap())
);
jCourseIDLayout.setVerticalGroup(
jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addComponent(jLabel6)
.addGap(4, 4, 4)
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jCourseIDLayout.createSequentialGroup()
.addComponent(jLabel8)
.addGap(32, 32, 32)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7))
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jCourseIDLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jCid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14)
.addComponent(jCourseName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jButton3))
.addGap(18, 18, 18)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(jButton1)
.addContainerGap(19, Short.MAX_VALUE))
);
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel3.setText("Select Semester");
jID.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel4.setText("Enter Your ID");
jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/icons8-enter-24.png"))); // NOI18N
jButton2.setText("Enter");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jSemester.setBackground(new java.awt.Color(204, 204, 204));
jSemester.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jSemester.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Summer 18", "Fall 18", "Spring 19" }));
jSemester.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jSemesterActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(136, 136, 136)
.addComponent(jSemester, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(160, 160, 160)
.addComponent(jID, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(86, 86, 86)
.addComponent(jButton2))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addComponent(jLabel3)
.addGap(209, 209, 209)
.addComponent(jLabel4)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2)
.addComponent(jSemester, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 11, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jCourseID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jCourseID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
con=Javav1.getConnection();
String select=(jSemester.getSelectedItem().toString());
try{
String sql="Select CourseID,CourseName,Credit,Section,Teacher from CourseList where ID=? and S_Name=?";
pst=con.prepareStatement(sql);
pst.setInt(1,Integer.parseInt(jID.getText()));
pst.setString(2, select);
rs = pst.executeQuery();
jTable.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception ex){
JOptionPane.showMessageDialog(null, ex);
}
finally{
try{
rs.close();
pst.close();
}catch(Exception ex){}
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jSemesterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSemesterActionPerformed
/*String select=(jSemester.getSelectedItem().toString());
if(select=="Spring 19"){
//DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
model.setRowCount(0);
Vector v1=new Vector(); //1st row
v1.add("CSE311");
v1.add("DBMS");
v1.add(3);
v1.add("N");
v1.add("Lamia Ruksura");
model.addRow(v1);//
String sql="Select CourseID,CourseName,Credit,Section,Teacher from CourseList where S_ID=191";
try {
pst=con.prepareStatement(sql);
rs = pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,ex);
}
}*/
}//GEN-LAST:event_jSemesterActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
Student_DashBoard lfg = new Student_DashBoard();
lfg.setVisible(true);
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
String cid=jCid.getText();
try{
String sql="select CourseName from CourseList where ID=? and CourseID=?";
pst = con.prepareStatement(sql);
pst.setInt(1,Integer.parseInt(jID.getText()));
pst.setString(2, cid);
rs = pst.executeQuery();
if(rs.next()) {
String Cname = rs.getString("CourseName");
jCourseName.setText(Cname);
}
}
catch(Exception ex){
JOptionPane.showMessageDialog(null, ex);
}
LiveResultShowTable();
}//GEN-LAST:event_jButton3ActionPerformed
/**
* @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(LiveResultStd.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(LiveResultStd.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(LiveResultStd.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LiveResultStd.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 LiveResultStd().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JTextField jCid;
private javax.swing.JPanel jCourseID;
private javax.swing.JTextField jCourseName;
private javax.swing.JTextField jID;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JComboBox<String> jSemester;
private javax.swing.JTable jTable;
private javax.swing.JTable jTable2;
// End of variables declaration//GEN-END:variables
}