Problem with UDP example

the example i am talking about is here http://www.corvstudios.com/tutorials/udpMultiplayer.php

i run the server, then the applet, but i am stuck at the very beginning

the server initializes properly
the client is a grey box, says click to start…

and i clicked and clicked and clicked in vain…

Hi,

Try this, in the UDPClient class, change the username and ipAddress variables in the init() method:


public void init()
{
        this.addKeyListener(this);
	username = "skinnyboy";
	ipAddress = "localhost";
        ....
}

done that still the same problem

this is the message on the console

Exception in thread “Thread-11” java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:5556 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
at java.net.DatagramSocket.send(Unknown Source)
at UDPClient.sendPacket(UDPClient.java:164)
at UDPClient.run(UDPClient.java:111)
at java.lang.Thread.run(Unknown Source)

You will need to sign your applet. Follow the instructions here: http://forums.sun.com/thread.jspa?threadID=174214

Here is the batch script I use (You will need to change the path and file names):


cd C:\Program Files\Java\jdk1.6.0_14\bin
keytool -genkey -keyalg rsa -alias mykey
keytool -export -alias mykey -file mycert.crt
cd C:\JarFileLocation
"C:\Program Files\Java\jdk1.6.0_14\bin\jarsigner.exe" MyJarFile.jar mykey
pause

i will suffice with studying the code and if ever need to use it (so having to test it as well)
i will ( go through all the trouble and ) sign the applet

thank you for your answer and time

Applets are components, so it’s pretty straightforward to wrap one in a frame and launch it as an application, getting round the need to sign.

nice one,
i will do just that!!!

thank you