Hey, I'm trying to design a simple interface and I'm getting this
error:
actionPerformed (java.awt.event .ActionEvent) in GUI cannot implement
actionPerformed (java.awt.event .ActionEvent) in
java.awt.event. ActionListener; overridden method does not throw
java.io.IOExcep tion
public void actionPerformed (ActionEvent event)
I'm sure this is fairly simple but i'm relatively new to java and
can't work it out!
The code for actionPerformed is as follows, where GetContent and
CompareFiles are outside classes which deal with the URL and GUI is
the name of the overall class...
-----------------------------
public void actionPerformed (ActionEvent event)
throws MalformedURLExc eption, IOException {
try {
URL url = new URL(enterURL.ge tText());
URLConnection connection = url.openConnect ion();
GetContent gc = new GetContent();
CompareFiles cf = new CompareFiles();
}
catch (MalformedURLEx ception err)
{
System.err.prin tln("Usage: java URLApp
http://www.URL.com");
}
catch (IOException e)
{
System.err.prin tln("Run software again to check if
content has changed.");
}
-----------------------------
Thanks a lot,
Geoff
error:
actionPerformed (java.awt.event .ActionEvent) in GUI cannot implement
actionPerformed (java.awt.event .ActionEvent) in
java.awt.event. ActionListener; overridden method does not throw
java.io.IOExcep tion
public void actionPerformed (ActionEvent event)
I'm sure this is fairly simple but i'm relatively new to java and
can't work it out!
The code for actionPerformed is as follows, where GetContent and
CompareFiles are outside classes which deal with the URL and GUI is
the name of the overall class...
-----------------------------
public void actionPerformed (ActionEvent event)
throws MalformedURLExc eption, IOException {
try {
URL url = new URL(enterURL.ge tText());
URLConnection connection = url.openConnect ion();
GetContent gc = new GetContent();
CompareFiles cf = new CompareFiles();
}
catch (MalformedURLEx ception err)
{
System.err.prin tln("Usage: java URLApp
http://www.URL.com");
}
catch (IOException e)
{
System.err.prin tln("Run software again to check if
content has changed.");
}
-----------------------------
Thanks a lot,
Geoff
Comment