Java Reference
In-Depth Information
Applets
An applet is a small program that can be downloaded and executed as part
of a displayed Web page. Applets, which are intended for general use by people
browsing the Web, are considered to be client-side , which means the applet
executes on the client machine. The client program still may rely on the server
or host for some resources, however.
Because applets run within a Web browser, they are subject to security
restrictions imposed by the browsers: they cannot read or write files on the client
system or connect to any computer other than the applet host. These restrictions
made it difficult to use applets for advanced programming applications, such as
word processing, until Sun Microsystems introduced a client-side helper applica-
tion. This helper application, called Java Web Start , functions much like
Windows Media Player and the RealOne Player, which launch when an audio file
is downloaded or opened. The browser launches the Java Web Start helper
application when it encounters certain Java commands and statements. For pro-
grammers, using the Java Web Start helper application makes deployment of
full-featured Java applications as easy as the HTML code used to start applets.
For users, Java Web Start means they can download and launch Java applica-
tions, such as a complete spreadsheet program, with a single click in a browser.
Some people associate Java's Web capabilities with JavaScript. While
JavaScript and Java sometimes are combined in an applet, JavaScript is different
from Java. JavaScript is a scripting tool, created by Netscape, used to insert code
statements directly into the HTML of a Web page, to add functionality and
improve the appearance of the Web page. Hypertext Markup Language
( HTML ) is a set of special codes called tags that specify how the text and other
elements of a Web page display. Unlike a JavaScript statement, which is embed-
ded in the HTML document, a Java applet is sent to the browser as a separate
file. A special HTML tag tells the browser where to find and execute the applet
file.
Examples of Java applets include a splash screen on the home page of a
Web site, an interactive animation or game as part of a Web page, or a program
that opens in a new browser window to perform a specific client-side function
(Figure 1-4).
FIGURE 1-4
Search WWH ::




Custom Search