I cannot seem to propagate the throws clause up the calling method.
Why?
The relevant code fragments are as below:
class WorldCupCountries{
public WorldCupCountries() throws URISyntaxException{
doSelectionNDisplay();
}
private void doSelectionNDisplay() throws URISyntaxException{
URL dirURL=getClass().getResource(path);
File dir=new File(dirURL.toURI());
}
}
public class Main {
public static void main(String[] args) throws URISyntaxException{
SwingUtilities.invokeLater(new Runnable(){
public void run() {
// Next line is the source of the error.
new WorldCupCountries();
}
});
}
}
Exception thrown: Exception in thread "AWT-EventQueue-0"
java.lang.RuntimeException: Uncompilable source code - unreported
exception java.net.URISyntaxException; must be caught or declared to
be thrown.
But I have declared it should be thrown by main(). All input is
greatly appreciated. Thank you.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---