-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJTableStudent.java
More file actions
43 lines (31 loc) · 867 Bytes
/
JTableStudent.java
File metadata and controls
43 lines (31 loc) · 867 Bytes
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
package com.cruds.swingproj;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
public class JTableStudent extends JFrame {
JTable stable;
JScrollPane scrollpane;
Vector<String> colNames;
Vector<Vector<String>> data;
BookDAO dao = new BookDAO();
public JTableStudent() {
setTitle("Student Table");
setSize(400, 400);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
colNames = new Vector<>();
colNames.add("Student USN");
colNames.add("Student Name");
data = dao.getStudentDetails();
stable = new JTable(data,colNames);
scrollpane = new JScrollPane(stable);
add(scrollpane);
setVisible(true);
}
public static void main(String[] args)
{
new JTableStudent();
}
}