Java Applets and Webstart
Java applets are mini-applications which run within another application. Applets actually could be run as a desktop application with Java's appletviewer.exe program. And actually, that may be the only way to make an applet run at the current day and time. Well, a better way to run an applet is to convert it to Web Start application which I talk about later on in this article.
Applets lost popularity
Applets are inserted into a web page with a single HTML applet tag. Later the standard changed on this and an HTML object tag was used instead. The tag gave the applet space on the page as a rectangular area of given dimensions in pixels. An applet might inhabit for example 400x400 on an 800x600 page.
<h3> Before HTML 5</h3>
<applet code="Bubbles.class" width="350" height="350"> Java applet that draws animated bubbles. </applet>
<h3>HTML 5 Method<h3>
<object type="application/x-java-applet" height="300" width="550"> <param name="code" value="Sample" /> <param name="archive" value="Sample.jar" /> Applet failed to run. No Java plug-in was found. </object>
<h2> The Sandbox </h2>
Applets may also not make network connections to other computers. They can only connect back to the computer they were loaded from. These security restrictions can be relaxed in a number of ways. Applets can be signed and have security certificates. Or a user may install a Java security policy file which grants the applets permission to do potentially dangerous things. We do this on our phones all the time, right? Or if the applet is loaded locally from the local hard drive it will have a different security policy and has access to the local system and networking. Applets do have usefulness which is why we now have the Java Web Start technology.
Java Web Start
Java Web Start technology is almost the same thing as the Java Applet technology except that it is a normal java application which runs in a Sandbox on your computer as a desktop GUI application with its own Frame. Security is the same for web start apps as it is for Applets. I do not have much to say about Java Web Start except to say that a special file type called .jnlp is needed to launch the web start app in a single mouse click on a web page link. It is then downloaded and started up in the sandbox. Applets and Web Start applications are both cached on the local hard drive in your browsers cache. Applets, Web Start Apps and cookies are all wiped off the hard drive with system cleanup task.