Chapter 5

Applets, HTML, and GUI's


JAVA IS A PROGRAMMING LANGUAGE DESIGNED for the world of modern networked computers. Java programs are meant to be downloaded over a network to run on any computer that implements the Java virtual machine. Java is fast becoming an integral part of the World Wide Web, the most interesting and fastest-growing Internet service, in the form of "applets" that can be directly embedded into Web pages.

A Java applet uses a GUI (graphical user interface), in which the user interacts with components such as buttons, menus, and text input boxes. User interactions with these components generate events, and an applet is programmed by specifying how it should respond to the various kinds of events that can be generated. An applet that wants to carry out some activity, such as an animation, independently of user events can create a separate thread to do so. Similar GUI's can be used in stand-alone applications as well as in applets.

This chapter covers some of the basics of applets, graphics, and GUI's. There is a section about the Web and about HyperText Markup Language (HTML), the language used for writing Web pages. I've also included a long section covering threads and animation. While threads are often used to animate applets, they have much wider use beyond the context of GUI's. The discussion of applets and GUI's will continue in the next chapter with a more complete discussion of components and events.


Sections in Chapter 5:

  1. The Basic Java Applet
  2. Introduction to Layouts, Components, and Events
  3. HTML Basics and the Web
  4. Threads and Animation
  5. Graphics and the Paint Method

[ First Section | Next Chapter | Previous Chapter | Main Index ]