applet socket

I am trying to make a socket to a server. The code below works in a regular program, but when I paste it into the init method of my applet, it has an error.

try

{

Socket Sockets = new Socket (server, port);

PrintWriter Out = new PrintWriter (Sockets.getOutputStream (), true);

BufferedReader In = new BufferedReader (new InputStreamReader (Sockets.getInputStream ()));

Out.println (stuffitssending);

while (true)

System.out.println(In.readLine());

}

Message was edited by:

hnghcgcgmghc

[559 byte] By [hnghcgcgmghca] at [2007-11-27 7:04:59]
# 1
what is the error?also, variables should be lowercase.
TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 2
How do I find the error in an applet? e.printStackTrace () doesn't work.
hnghcgcgmghca at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 3
are you using Java 6? on windows there is a Java Consolein the system tray. not sure about macs.worst case scenario, for debugging write the erroroutputs to a text component.
TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 4
java.security.AccessControlException: access denied (java.net.SocketPermission irc..org resolve)Message was edited by: hnghcgcgmghc
hnghcgcgmghca at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 5
(sigh) Applet Security FAQ: http://java.sun.com/sfaq/
DrClapa at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 6

Oh woops. I should have known that.

Applets are locked down pretty severely. You cant even

read/write a file and you certainly cant open a socket.

You have to sign your applet.

How do you sign an applet?

http://www.google.com/search?hl=en&q=how+sign+applet

Search the forums (theres even a whole section).

TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 7
Is signing an applet free? And are all irc applets really signed?
hnghcgcgmghca at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 8
i REALLY hate Applets so I am biased but i prefer Java Web Start. http://en.wikipedia.org/wiki/Java_Web_Startas for your questions see DrClaps FAQ link.
TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 9
echo
TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 10
echo
TuringPesta at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 11
please help me how do I sign the applet?
hnghcgcgmghca at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...
# 12
Please I NEED a way to make a socket applet without signing it. Please there must be a way to do it. It's really important.
hnghcgcgmghca at 2007-7-12 18:56:17 > top of Java-index,Java Essentials,Java Programming...