当我按下投诉框时,每个输入对话框显示两次...我尝试删除 boxComplain.setSelected(true) 并且它有效(它只显示一次)但是这使得复选框在我输入输入后消失。
class CheckBoxListener implements ItemListener {
public void itemStateChanged(ItemEvent event) {
if(boxComplain.isSelected())
{
ab=JOptionPane.showInputDialog("Enter Reason of Complain: ");
ac=JOptionPane.showInputDialog("Enter What The Complain is About: ");
label4.setText("Complain request");
boxComplain.setSelected(true);
}
}
}