Applets
Visit us here and you will find
much more tips!
Receive our newsletter with new tips! Almost 6,000 subscribers (by June 2001) can not be wrong!
They read our tips every week!
To subscribe to The Java FAQ Daily send empty e mail to:
javafaq tips subscribe@topica.com
or visit at:
http://www.topica.com/lists/javafaq tips/
Applets
I ve got problems with the Socket class (network)
I ve got problems with the Socket class. I use it inside an applet (I ve
written a small chatbox). I have code like this:
Socket s = new Socket("192.168.0.4", 13780);
When the server I m connecting to is on the same machine as the client, it works.
When the server is an other machine, both NS and IE give an error message like:
Security:Can t connect to 192.168.0.4 with origin
Does anyone know how I can fix this??
Answer: The standard security concept for an applet is the sandbox . An applet can t talk
outside it s memory space, can t talk to any files at all, and cannot talk to
anything on the internet except the same machine that it s parent
HTML page originated from. So your applet can never talk to 192.168.0.4
unless the HTML came from 192.168.0.4
How do I view the error output from my Java applets in IE?
Answer: The file windows\Java\Javalog.txt contains info about the last Applet loaded in IE.
All the System.out messages and exception information is stored here when Java Logging
is enabled in IE. To enable Java Logging start IE and select View/Options/Advanced.
Select "Enable Java Logging" check box click OK. Restart IE.
In NT4 the file in C:\WINNT\Java
Is there a way to reduce the amount of time that it takes to download an applet?
Answer: There is a way to reduce the amount of time an applet takes to download. What ever classes
the Java applet is refering, you cluster them in a JAR file with the help of JAR utility that comes with
the JDK version. Check out the help for the options of that utility and make a ".jar" file out of the
applets refered classes and images and other relevent data which you want to load.
Use the archive option of the applet tag and assign the .jar file:
file:///F|/a_jsite/350_tips/applets.htm (1 of 9) [2001 07 08 11:24:47]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved