Re: Problem with an applet
Are you reading the images from disk? Applets run in a security 'sandbox', which means they are not permitted to read from or write to the client machine. Check the Java console for security exception messages.
See What Applets can and can't do, Applet Security, etc. Google 'java applet security' for more.
Any programming problem can be solved by adding a level of indirection...
Anon.
Re: Problem with an applet
I was reading them from the disc but after I tried to read them like this nothing happened and I see absolutely nothing now:
Code:
private static URL url;
private static Toolkit tk = Toolkit.getDefaultToolkit();
private static Image image;
private void setURL()
{
try{
url = new URL("http://img136.imageshack.us/img136/8159/something.jpg");
} catch (MalformedURLException VariableDeclarationID) {}
image = tk.getImage(url);
}
and then invoke the above method in the constructor.
How do I make it read it not from the disc and not from a website???
Re: Problem with an applet
So what does the Java console say? Does it show any error messages?
Why do we never have time to do it right, but always have time to do it over?
Anon.
Re: Problem with an applet
It doesn't say anything bad. Well, I figured out the problem - removed static from the URL. Now the problem is how to get the URL of my images and use them without uploading them separately on the Internet? And even one more problem: I see the applet in Eclipse but again, I don't see it in the browser.