Code:
public void start()
{
//makes a connection to the actual image
///
///
URL imageLocation = null;
URLConnection connection = null;
try {
imageLocation = new URL("http", "www.klamath.net", "/main2.jpg");
}
catch (MalformedURLException ex) {
System.out.println("URL did not form properly");
}
System.out.println(imageLocation);
///////////////////////////////////////////////
//Now connect to the url
try {
connection = imageLocation.openConnection();
System.out.println(connection + " CONNECTION");
System.out.println(connection.getContent());
}
catch (IOException ex) {}
catch (java.security.AccessControlException ex) {
System.out.println("It won't let me in!");
ex.printStackTrace();
}
}
Here why I'm doing what I'm doing.
I wanted to get back into java before school started and I thought a good place to start would be internet issues with java (was wrong ). jokes aside, I want to be able to get a URL from a website every 5 seconds.
To do that, I need to be able to successfully get the image I need.
(Eventually I'll want to add functions so that my applet checks to see when the next image will be uploaded (it's every 5 seconds) and then gets the new pic when it really is new, maybe just one second behind.)
When the above code runs, I am denied access. How do I get around this?