Applets, HTML, and GUI's
JAVA IS A PROGRAMMING LANGUAGE DESIGNED for networked computers and the World Wide Web. Java applets are downloaded over a network to appear on a Web page. Part of learning Java is learning to program applets and other Graphical User Interface programs. GUI programs are event-driven. That is, user actions such as clicking on a button or pressing a key on the keyboard generate events, and the program must respond to these events as they occur.
Event-driven programming builds on all the skills you have learned in the first five chapters of this text. You need to be able to write the subroutines that respond to events. Inside these subroutines, you are doing the kind of programming-in-the-small that was covered in Chapters 2 and 3. And of course, objects are everywhere. Events are objects. Applets and other GUI components are objects. Events are handled by instance methods contained in objects. In Java, event-oriented programming is object-oriented programming.
This chapter covers the basics of applets, graphics, components, and events. There is also a section that covers HyperText Markup Language (HTML), the language used for writing Web pages. The discussion of applets and GUI's will continue in the next chapter with more details and with more advanced techniques.
Contents Chapter 6:
- Section 1: The Basic Java Applet and JApplet
- Section 2: HTML Basics and the Web
- Section 3: Graphics and Painting
- Section 4: Mouse Events
- Section 5: Keyboard Events
- Section 6: Introduction to Layouts and Components
- Programming Exercises
- Quiz on this Chapter
[ First Section | Next Chapter | Previous Chapter | Main Index ]