fbpx
Responsive Ad Area
Home » Blog » Applets Webstart: Java Applets and Webstart

Share This Post

Applets / Webstart

Applets Webstart: Java Applets and Webstart

Java Applets and Webstart

Java Applets

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

Java applets were quite the rage when Java first appeared on the scene. Applets are primarily run on a web page. However over time they lost popularity. Reasons for this might include applets being slow to startup. Another was applets not starting up at all which usually had a fix but was frustrating enough from the end user point of view to cause a loss in popularity. Applets may have enjoyed their greatest success in the case of in-house programming within corporations. One very well used applet to date might be the RPG game called Runescape. Other popular alternatives to the use of Applets were Javascript and Macromedia Flash. I still recommend using applets when learning Java because it’s an easy way to start out with GUI(Graphical User Interface). At any rate, this gave rise to Java Web Start technology.

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 400×400 on an 800×600 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>

Applet and Web start applications run in what is known as a Security Sandbox. This means that applets do not have access to ram, to hard drive space or any storage space. Well, they can store and read Java cookies. Cookies might be a whole other article.  Javascript, Web Start, Java Servlets and JSP can also access cookies. A cook is 4096 bytes of storage on your hard drive in text files where each cookie is a name=value pair. Don’t worry, cookies can’t have viruses or malware, though they can be read and written by any application on your computer that has not been controlled by security features, such as viruses and malware. This doesn’t mean you should disable them however, it simply means you should be more careful about protecting your computer from viruses and malware.

 

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.

Share This Post

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>