unreported IOException problem
hi,
i am trying to call one method from different file but getting this error..
Quote:
callMethod.java:31: unreported exception java.io.IOException; must be caught or declared to be thrown
i already reported this exception in that method but cant understand where else need to report ?
Code:
public class callMethod extends JFrame implements ActionListener {
JButton button;
callMethod(){
button=new JButton("show"); button.addActionListener(this);
add(button);
}
public static void main(String[] args) throws IOException {
callMethod cm=new callMethod();
cm.setSize(200,100);
cm.setVisible(true);
}
public void actionPerformed (ActionEvent e) {
if (e.getSource()==button) {
MyFile file=new MyFile();
String[][] show=file.method("get", "20"); //error mentioned in this line
..
..
}
}
the method of MyFile:
Code:
public String[][] method(String name, String value) throws IOException {
...
..
i can run it from MyFile but cant call from different file...
pls help me...