Thank you for visiting Blazing Games

Applets vs Applications

If you are interested in learning Java for the ability to write applets you should still know about how writing an application differs from writing an applet. In fact there are more similarities between Applets and Applications then differences. Some programmers, in fact, find it easier to develop their game using an application that can also run as an applet. Likewise, when we get into creating our own class library, we can take advantage of how applications work in order to create a testing application within the class.

Java applications are full fledged programs and with the exception of language limitations have no restrictions on what they can do. Even the language limitations can be bypassed by use of the JNI interface which lets you execute native code. I have found very little that Java is not capable of doing, so most the reasons for using native code would strictly be for speed reasons. It is also possible to compile Java applications into native executable files, though by doing this you will lose cross platform compatibility.

An applet can be thought of as a mini-application. The applet is run within a web browser and is used to add additional functionality to web pages without requiring that the user download plug-ins. In order to prevent malicious programmers from doing bad things to the computer through an applet, they are required to run in something called a sandbox. The theory of a sandbox is that the applet is restricted in what it is able to do. Applets can not run native code, start the execution of programs or batch files on the system, delete, read, or modify files on the system, and are limited to communicating with the server in which the applet was loaded from.

You would use an applet in the case that you wanted people to use your program over the internet. The restrictions of the sandbox, however, can limit what you can do. Applications are more serious programs. It is possible to have people download applications and run them on their computers, but my experience shows that many people do not like downloading programs.

Previous Chapter 3 Contents Page 2 of 10 Book Contents Next

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2005-2006 Blazing Games Inc. All Rights Reserved