关与JButton的问题
为什么一个actionperformed事件会出发两次?
看下面代吗:
public void updateok_actionPerformed(ActionEvent e) {
String today=Integer.toString(calendar.get(calendar.YEAR))+"-"+Integer.toString(calendar.get(calendar.MONTH))+"-"+Integer.toString(calendar.get(calendar.DAY_OF_MONTH));
if(memoContent.getText().trim().equals("")){
JOptionPane.showMessageDialog(null,"请输入内容!","Error",JOptionPane.ERROR_MESSAGE);
}
else{
dbobj.InsertValue(today,memoContent.getText());
JOptionPane.showMessageDialog(null,"添加成功!","Information",JOptionPane.INFORMATION_MESSAGE);
}
}
点击该按纽后跳出2条添加成功的提示信息,并且数据库里面有两条记录,不知道为什么,请高手指点。