曾祥彬 发表于 2012-6-16 13:43
代码都不放出来,图也没有,谁的想象力有那么好啊!哥!!!
list变量是查询出的内容
private void updateTable(List list, final DefaultTableModel dftm) {
int num = dftm.getRowCount();
for (int i = 0; i < num; i++)
dftm.removeRow(0);
iterator = list.iterator();
while (iterator.hasNext()) {
List info = (List) iterator.next();
MbM = new MemberMessage();
MbM.setId((String) info.get(0));
MbM.setCardnumber((String) info.get(1));
MbM.setCreditgrade((String) info.get(2));
MbM.setUsername((String) info.get(3));
MbM.setSex((String) info.get(4));
MbM.setPhone((String) info.get(5));
MbM.setUsercard((String) info.get(6));
MbM.setPassword((String) info.get(7));
MbM.setDifference((String) info.get(9));
MbM.setPhoto((String) info.get(10));
MbM.setState((String) info.get(11));
MbM.setSystemtime((String) info.get(12));
MbM.setRemark((String) info.get(13));
Vector rowData = new Vector();
rowData.add(MbM.getId());
rowData.add(MbM.getUsername());
rowData.add(MbM.getSex());
rowData.add(MbM.getCardnumber());
rowData.add(MbM.getCreditgrade());
rowData.add(MbM.getState());
rowData.add(MbM.getPhone());
rowData.add(MbM.getUsercard());
rowData.add(MbM.getDifference());
rowData.add(MbM.getPassword());
rowData.add(MbM.getPhoto());
rowData.add(MbM.getSystemtime());
rowData.add(MbM.getRemark());
dftm.addRow(rowData);
}
} |