HTML and CSS Reference
In-Depth Information
Introducing Java
Maxine has included a cast list for Royal Wedding on her Web site. Currently, the list
displays only a few of the actors and actresses from the movie. Maxine would like to
expand the list to include more of the cast as well as the director, producers, and writ-
ers; however, doing so would result in a list so long that it would ruin her page layout.
Instead of a long list, Maxine envisions a scrolling cast list mimicking the credits that
appear at the end of a movie. Maxine has seen scrolling text on other Web sites and
wonders if you could add a similar feature to her Web page. You can do so with a pro-
gramming language called Java.
As with many computing innovations, Java came from some unexpected sources. In
the early 1990s, programmers at Sun Microsystems envisioned a day when common
appliances and devices, such as refrigerators, toasters, and garage door openers, would
be networked and controllable using a single operating system. Such an operating system
would need to be portable because it obviously would need to be able to work with
a wide variety of devices. The programmers began development on such an operating
system and based it on a language called Oak. The project did not succeed at that point
(perhaps the world was not ready for toasters and refrigerators to communicate), but the
initial work on Oak was so promising that Sun Microsystems saw its potential for use on
the Internet. Oak was modified in 1995 and renamed java .
Java programs are stored in executable files called class iles , which have the file
extension .class . Some Java applications might require several class files to run properly.
Each class file is run within a java virtual Machine , a software program that runs the
class file and returns the results to the user's computer. Java Virtual Machines can be
created for different operating systems, so a Java program can be run from any operating
system, including UNIX, Windows, DOS, and Mac OS. Just as Web pages were designed
at the beginning to be platform-independent, so was Java, and it became a natural it for
use on the Web. Web browsers soon began supporting Java Virtual Machines and Web
developers began using Java to add interactive features to their Web sites.
A Java program is not a stand-alone application, but instead runs in conjunction with
a hosting program such as a Web browser. The program is therefore a mini application
or applet . When a user connects to a Web page containing a Java applet, the applet is
downloaded along with the Web page from the Web server; but the applet itself runs
within the Java Virtual Machine on the user's computer. This frees up the Web server for
other tasks, as shown in Figure 7-35.
Figure 7-35
applets and java virtual Machines
1. The user's Web
browser downloads the
Web page and an applet
from the Web server.
2. The Java Virtual Machine built
into the browser runs the applet
on the user's computer.
interpreter
 
Search WWH ::




Custom Search