TeamJava Forum
[ Read Responses | Post a New Response | Return to the Index ]
[ Previous | Next ]
Socket permissions in java
Posted by Srinivas on Tuesday, 17 June 2003, at 2:06 a.m.
How can i get socket permission from other sites to paint images on my applet.
Here is the program i have written to paint an image on the applet.
But i am getting this exception:
java.security.AccessControlException: access denied (java.net.SocketPermission www.geocities.com resolve)
Here is the source code for this:
import java.awt.*;
import java.applet.Applet;
import java.net.*;
public class paintimage extends Applet
{
Image img;
public void init()
{
try{
img=getImage(new URL("http://www.geocities.com/knowledgecollege/delta.jpg"));
}
catch(Exception e)
{
System.out.println(e);
}
}
public void paint(Graphics g)
{
if(img!=null)
g.drawImage(img,10,10,this);
}
}
----------------------------------------------------------
Responses
Post a New Response
The TeamJava Forum is maintained with WebBBS 2.24.