Help needed with java

Status
Not open for further replies.

dnoch

Daemon Poster
Messages
656
Hi all
Im busy writing this program for my computers major project, and im having a bit of trouble throwing the IOException. Here is an extract of my code:

Code:
button3.addActionListener(new java.awt.event.ActionListener() {
	    public void actionPerformed(java.awt.event.ActionEvent evt) {
		button3ActionPerformed(evt);
	    }
	});
Since i have a file writer within the method that button3 calls (note that this is a gui, not text based), it is giving me an error that that method must throw the IOException, yet if i throw the IOException, it gives me the following error:
Code:
actionPerformed(java.awt.event.actionEvent) in cannot implement actionPerformed(java.awt.event.actionEvent) in java.awt.event.actionListener ; overriden method does not throw java.io.IOException

I tried putting it in a try catch statement, but netBeans won't allow me to do that.

If anyone knows where i should go from here, i would be grateful for any tips or advice.

Thank you in advance
 
Status
Not open for further replies.
Back
Top Bottom