我想点击一个按纽时把从数据库中查询到的结果(一个ResultSet)显示出来,但系统提示要放在有throws Exception 的函数中,我在此按扭的响应函数后加上throws Exception后,又有新的错误,
"searchmeeting.java": actionPerformed(java.awt.event.ActionEvent) in agenda.searchmeeting_enter_actionAdapter cannot implement actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener; overridden method does not throw java.lang.Exception at line 138, column 3
请问怎样解决?谢谢!
"searchmeeting.java": actionPerformed(java.awt.event.ActionEvent) in agenda.searchmeeting_enter_actionAdapter cannot implement actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener; overridden method does not throw java.lang.Exception at line 138, column 3
请问怎样解决?谢谢!
必须和原方法格式一样 public void actionPerformed(ActionEvent ae){}
不能用throws抛出异常
ResultSet 用try{}catch(Exception e){}块捕获