Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


For this and other reasons, the downloaded Java program is not considered a full application, but rather a mini–application or applet.

Current browsers let you include Java applets using the APPLET element, as illustrated in Figure 2.32. This element can contain two important parts: PARAMETER elements that define parameters required by the running applet and regular HTML markup that is displayed by browsers that do not understand


Figure 2.33  Rendering of the document in Figure 2.32 by the Microsoft Internet Explorer 3 browser.

APPLET or that are incapable of running Java programs. The APPLET element can take several attributes: HEIGHT, WIDTH, HSPACE, VSPACE, and ALIGN have the same meanings as with images, while CODEBASE indicates the URL where the applet software comes from, and CODE gives the name of the actual applet program at this URL.

Figure 2.33 shows the resulting document as displayed by the Microsoft Internet Explorer 3.0 browser—both Microsoft and Netscape support Java in their browsers. The applet appears as the graphic to the right, which is an animation that illustrates binary search tree rotations—an important concept in computer science. The reader can actually click on the balls causing these rotations and, in doing so, learn about this important database concept.

Like EMBED, APPLET is being replaced by the more flexible OBJECT element. OBJECT is supported by both Netscape Navigator 4 and Internet Explorer 4.

Java applets offer enormous promise for building dynamic, interactive Web pages. However, writing Java programs is not like writing HTML. Java is a full–blown programming language, comparable to C++, so that writing Java programs is complex and not for the faint of heart! Also, Java applets, accessed over the Web, are often large files that take a long time to download—it is not uncommon to wait minutes for large applets to arrive. Also, as with plugins, you need modern, fast machines with lots of memory to run applets with acceptable speed and response times—a 100 MHz Pentium processor with 16 MB of memory is a good minimum configuration. Thus, be careful when jumping on the Java bandwagon in case you find yourself delivering content that cannot be used by your users. Possibly the best environment for Java is inside a corporate intranet, where you can predict the types of equipment and software accessible to the users. Possibly the worse environment is one where you want to make Web resources accessible to the widest possible audience.

Document Scripting: Javascript and VBScript

If you can download programs and run them on the browser, why can’t you also incorporate programs within the HTML documents?

This is now possible using two scripting languages: JavaScript, developed by Netscape and Sun Microsystems, and VBScript (Visual Basic Script), developed by Microsoft. Scripting languages are discussed in Chapter 7.

Lessons from Example 12

1.  The APPLET element is used to embed a program applet within an HTML document. This element can contain HTML markup as well as PARAMETER elements to define parameters needed by the applet. The APPLET element also takes attributes needed to define the location (CODEBASE) and name (CODE) of the requested applet, and to specify the size and location for the applet on the window (HEIGHT, WIDTH, HSPACE, VSPACE, and ALIGN.)
2.  The OBJECT element (see Chapter 6) is a likely successor to the experimental APPLET tag. Browsers will, however, be backward–compatible with the APPLET element.

Exercises for Example 12

Try visiting some sites containing applets to get a flavor for what they can do and also to get a flavor for the time it takes to download a large applet over the Internet. A large repository of Java applets can be found at:

www.gamelan.com

This is a good place to find Java examples. You might even find an applet you want to use.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.