Why did you change it from an app? An app will be able to connect to any website.
An applet can ONLY connect to the site it is loaded from.
If you have a website with a server that the applet is...
Type: Posts; User: Norm
Why did you change it from an app? An app will be able to connect to any website.
An applet can ONLY connect to the site it is loaded from.
If you have a website with a server that the applet is...
Use an application. It won't have any Java security issues.
What class is the getCode() method in?
ForSecurity. The applet can only communicate with its host.
If you load the applet from that site, it will be able to connect to it.
Your applet is trying to do something it is NOT allowed to do.
Applets can only connect to the host that they were loaded from. The Socket at line 107 is trying to connect to a forbidden host.
...
Did you leave the add() statements? They are what will put something in the applet to be seen.
You need to set the layout manager for the Applet to be able use: add(...,c);
Or remove all references to the GridbagConstraints class and the c variable.
look at line 44 and see if the error makes any sense
Where do you set the layout manager?
Move the code in main() to an init() method. Have the class extend JApplet. Get rid of createAndShow()