Hi there,
I have a Java application that reads some information from a file on the file system.
It is really basic, I have some info on the application that the user enter and then the user hits a button. From there the application calls a new class that does some IO from a file and then returns.
However, the actionPerformed method I am using does not seem to allow IOExceptions here is a sample:
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class mainWindow implements ActionListener
{
JButton go = new JButton("Go");
public void actionPerformed(ActionEvent e)
{
//This loads my IO class
doIO getInfo = new doIO( );
public mainWindow
{
//does all the mainWindow things
go.addActionListener(this);
}
}
That is basically my window that calls the other class, obviously there is a lot of fundametals missing but the main problem is in the actionPerformed method.
When I try and do that I get the error "Unhandled Exception type IOException"
This is where the problem gets a little wierd, my class doIO looks something like this:
import java.io.*;
public class doIO
{
public doIO ( ) throws IOExcpetion
{
//All my Io Stuff
}
{
Since the method actionPerformed in part of the Interface ActionListener I cannot use the "throws IOException" on that method.
Any suggestions?