-
Notifications
You must be signed in to change notification settings - Fork 0
/
JTableBMS.java
42 lines (34 loc) · 890 Bytes
/
JTableBMS.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
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 JTableBMS extends JFrame
{
JTable table;
JScrollPane scrollpane;
Vector<String> colNames;
Vector<Vector<String>> data;
BookDAO dao = new BookDAO();
public JTableBMS() {
setTitle("JTable BMS Proj");
setSize(400, 400);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
colNames = new Vector<>();
colNames.add("ISBN");
colNames.add("Title");
colNames.add("Category");
colNames.add("No of Books");
data = dao.getTableData();
table = new JTable(data,colNames);
scrollpane = new JScrollPane(table);
add(scrollpane);
setVisible(true);
}
public static void main(String[] args)
{
new JTableBMS();
}
}