import java.applet.*;
import java.awt.*;
import java.net.*;
public class WebApplet extends Applet {
private Image myImage;
private URL ImageURL;
public void init() {
resize(300,300);
try {
ImageURL=new URL("http://www.mtu.ru/bridge.jpg");
}
catch(MalformedURLException e) {System.out.println("Error in URL"); }
myImage=getImage(ImageURL);
}
public void paint(Graphics g) {
g.drawImage(myImage,20,20,this);
}
}
But this program doesn't want to run. I use Netscape Navigator 4.04 .
He has reported the following errors:
# Security Exception: class from local disk trying to
access url:http://www.mtu.ru/bridge.jpg
# Applet exception: exception: java.lang.NullPointerException
java.lang.NullPointerException
The Appletviewer program has reported:
java.security.AccessControlException:access denide
(java.net.SocketPermission www.mtu.ru resolve)
What's the matter ? I'll be very glad if you explain me the causes of
this problem. Also I want to say that I use Windows95 (not OSR2 !) and
I read in your help-file that the Winsock v.1.1 is not reliable for
this JDK. May be the problem is in my Winsock ?
Thank you.
Developer from Russia,
Vasily