DefaultTableModel
Swing填充表格的类
DefaultTableModel dtm = (DefaultTableModel) bookTypeTable.getModel();
dtm.setRowCount(0);
Connection con = null;
try {
con = dbUtil.getCon();
ResultSet rs = bookTypeDao.getBookTypeList(con,bookType);
while (rs.next()) {
Vector v = new Vector();
v.add(rs.getInt("id"));
v.add(rs.getString("bookTypeName"));
v.add(rs.getString("bookTypeDetail"));
dtm.addRow(v);
}
.addRow(v) 方法结合Vector类来实现表格填充