偶的数据库连接 方法init(Connection connection)
我用JTable 显示数据库中的所有记录关键代码 // display table with ResultSet contents
table = new JTable( rows, columnHeads );
JScrollPane scroller = new JScrollPane( table );
getContentPane().add( scroller, BorderLayout.NORTH );
validate(); rows,columnHeads 是两个vector
我用JTable 显示数据库中的所有记录关键代码 // display table with ResultSet contents
table = new JTable( rows, columnHeads );
JScrollPane scroller = new JScrollPane( table );
getContentPane().add( scroller, BorderLayout.NORTH );
validate(); rows,columnHeads 是两个vector
DefaultTableModel model = new DefaultTableModel();
JTable table = new JTable(model);
JScrollPane scroller = new JScrollPane( table );
getContentPane().add( scroller, BorderLayout.NORTH );方法init(Connection connection) {
更新数据
model.setDataVector(rows, columnHeads );
table.revalidate();
table.show(true);
}