access control exception...

hi there,

i have an swing applet that displays an url and i m using jeditorpane to display that url on my browser and i get this exception

" java.security.AccessControlException:acces denied (java.net.SocketPermission 192.168.1.1 connect,resolve) "

how do i solve this problem.

here is my code :

import javax.swing.*;

import java.awt.*;

public class AppletB extends JApplet {

public AppletB()

{

try {

JEditorPane editorPane = new JEditorPane("http://192.168.1.1");

JScrollPane scrollpane = new JScrollPane(editorPane);

getContentPane().add(scrollpane, BorderLayout.CENTER);

}

catch (Exception urlmal)

{

JOptionPane.showMessageDialog(null,urlmal.toString(),"error",JOptionPane.WARNING_MESSAGE);

}

}

}

[870 byte] By [ppdhans] at [2007-9-26 2:17:56]
# 1

Hi,

Please download the plugin from

http://java.sun.com/plugin. Use the latest version of plugin. Then run the browser with plugin.

Please refer this URL for configuring the Swing with browser.

http://wwwipd.ira.uka.de/~jjh/tools/swing/products/jfc/swingdoc-current/applets.html

If still you are getting the security exception, Please use the policy file which is created by policy tool command.

Please refer this URL in order to know more about policy file.

http://java.sun.com/docs/books/tutorial/security1.2/tour1/index.html

I hope this will help you.

Thanks

Bakrudeen

bakrudeen_indts at 2007-6-29 9:18:15 > top of Java-index,Archived Forums,Java Programming...