-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0AdminUpcomingSession.java
More file actions
73 lines (60 loc) · 1.93 KB
/
Copy path0AdminUpcomingSession.java
File metadata and controls
73 lines (60 loc) · 1.93 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
/*
* 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 cdvirtualserver;
import java.awt.*;
import java.util.Vector;
import javax.swing.*;
/**
*
* @author Chayan-Dhaddha
*/
public class AdminUpcomingSession extends JPanel{
Vector<String> HEAD;
Vector DATA;
JTable table;
JScrollPane jsp;
public AdminUpcomingSession(){
this.setLayout(null);
HEAD=new Vector<String>();
HEAD.add("INITIATED_BY");
HEAD.add("TOPIC");
HEAD.add("DATE");
HEAD.add("TIME");
HEAD.add("DURATION");
DATA=new Vector();
table=new JTable(DATA,HEAD);
jsp=new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
this.design();
Session session=new Session();
}
void design(){
this.setPosition(jsp,50,80,1200,550);
}
void setPosition(Component C,int x,int y,int w,int h){
this.add(C);
C.setBounds(x,y,w,h);
}
class Session extends Thread{
String query;
public Session(){
this.start();
}
public void run(){
query="select initiated_by,topic,session_date,session_time,duration from session where status=0";
try{
while(true){
Vector<Vector> list=ConnectionFactory.getInstance().getData(query);
DATA.clear();
for(int i=0;i<list.size();i++){
DATA.add(list.elementAt(i));
}
table.repaint();
}
}catch(Exception ex){
}
}
}
}