Hi everyone here is the source code that causes this exception:
import javax.swing.*;
import java.io.*;
import java.net.*;
public class ImageDownloader extends JFrame {
public static void ImageDownloader(){
try
{
URL url = new URL("http://www.doodletype.com/Downloads/backy.jpg");
InputStream in = url.openStream();
OutputStream out = new BufferedOutputStream(new FileOutputStream("/ApplicationData_DoodleType/backy.jpg"));
for (int b; (b = in.read()) != -1; ) {
out.write(b);
}
out.close();
in.close();
}
catch(IOException e)
{
System.out.println("Error: "+e);
}
System.exit(0);
}
}
Not sure why it gives this error but this program which is used to download a simple picture for a program I am developing works perfectly on Windows Vista and Mac OS X. However it doesn't work on my Windows XP computer instead it gives this exception: java.net.SocketException: Invalid argument: connect. Not sure why it would do this only for Windows XP. I was thinking it might just be somthing wrong with my computer but i'm not sure yet I haven't been able to test it on any other XP computers. I have the latest version of Java installed and am running Windows XP Media Center Addition. Any help would be great thanks. :)