4.1.1 Java Applications Versus Java Applets
Java programs that run in a browser are called applets. Applets are small, easily downloaded parts of an overall application that perform specific functions. Many popular browsers impose limitations on the capabilities of Java applets in order to provide a high degree of security for the users of the browser. Applets have the following restrictions:
- An applet ordinarily cannot read or write files on any host system.
- An applet cannot start any program on the host (client) that is executing the applet.
- An applet can make a network connection only to the host from which the applet originated; it cannot make other network connections, not even to the client machine.
Programming workarounds exist for most restrictions on Java applets. Check your browser’s Web site (for example, www.netscape.com or www.microsoft.com) or developer documentation for specific information about the applet capabilities that the browser supports or restricts. You can also use Jolt Relay to work around some of the network connection restrictions.
A Java application, however, is not run in the context of a browser and is not restricted in the same ways. For example, a Java application can start another application on the host machine where it is executing. While an applet relies on the windowing environment of a browser or appletviewer for much of its user interface, a Java application requires that you create your own user interface. An applet is designed to be small and highly portable. A Java application, on the other hand, can operate much like any other non-Java program. The security restrictions for applets imposed by various browsers and the scope of the two program types are the most important differences between a Java application and a Java applet.
Parent topic: Class Library Functionality Overview