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

Please select: Discussion Question Answer
Pulse Check - enter num: 1068239055

Your Name:

E-Mail Address:

Subject:

Message:


If you'd like to include a link to another page with your message,
please provide both the URL address and the title of the page:

Optional Link URL:

Optional Link Title:


If you'd like to have the option of deleting your post later,
please provide a password (CASE SENSITIVE!):

Password:



Password:

The TeamJava Forum is maintained with WebBBS 2.24.


TeamJavaHome | Ind. Registry | Co. Registry | Java Links
Jobs Listings Forum | TeamJava Books | Java FAQ Archives

AWN

Copyright © 1995-2003 Active Web Networks, all rights reserved.
(Note: We share no direct association with Sun Microsystems, Inc.)