50,533
社区成员
发帖
与我相关
我的任务
分享
int index = list.getSelectedIndex();
if (index == -1 || index >= dataM.getSize()) {
JOptionPane.showMessageDialog(this, "请选择要删除的内容!", "Sorry",
JOptionPane.ERROR_MESSAGE);
} else if (list.getSelectedValue().equals("客户")) {
JOptionPane.showMessageDialog(this, "此项不可删除!", "Sorry",
JOptionPane.ERROR_MESSAGE);
} else {
dataM.removeIndex(index);
System.out.println(list.getSelectedIndex());
System.out.println(list.getSelectedValue());
clj.st.executeUpdate("Delete From QYSMLei where LeiBie='" +
list.getSelectedValue() + "'");
JOptionPane.showMessageDialog(this, "删除成功", "OK",
JOptionPane.INFORMATION_MESSAGE);
}
list.updateUI();