- int rowNun = this.jt.getSelectedRow();
- String sql = "delete from meb where meb_Id=?";
- MebModel mebmodel = new MebModel();
- int[] paras = {Integer.valueOf(String.valueOf(mebmodel.getValueAt(rowNun, 0))).intValue()};
- MebModel temp = new MebModel();
- if(temp.del(sql, paras))
- {
- JOptionPane.showMessageDialog(this, "删除成功");
- queryAll();
- new AddRecord("删除人员信息",manager.getName());
- return;
- }
- else
- {
- JOptionPane.showMessageDialog(this, "删除失败");
- }
复制代码 JTable本身有让你获取某一行的方法:int rowNun = this.jt.getSelectedRow();
在Model中有得到某行某列的方法getValueAt(int row,int col) |