我不确定为什么我的代码不能正常运行,它可能很容易修复,但我想从页面获取输入,我收到一个错误,指出在这种情况下,选择的项目不能转换为对象选定的列
void delete() throws SQLException{
int input = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete?", "Delete", JOptionPane.YES_NO_OPTION);
if (input == JOptionPane.YES_OPTION) {
DVDItem user = (DVDItem)tableDVD.getModel().getValueAt(tableDVD.getSelectedRow(), tableDVD.getSelectedColumn());
mc.deleteItem(user.getkey());
}
updateList();
}
我该如何制作它以便将其转换为 DVDItem 对象,然后通过访问其密钥来删除,谢谢